OpenApiRefExt

Trait OpenApiRefExt 

Source
pub trait OpenApiRefExt {
    // Required methods
    fn component_name(&self, component: &str) -> Option<&str>;
    fn resolve_response<'a>(
        &self,
        components: Option<&'a Components>,
    ) -> Option<&'a Response>;

    // Provided methods
    fn schema_name(&self) -> Option<&str> { ... }
    fn response_name(&self) -> Option<&str> { ... }
    fn parameter_name(&self) -> Option<&str> { ... }
    fn example_name(&self) -> Option<&str> { ... }
    fn request_body_name(&self) -> Option<&str> { ... }
    fn header_name(&self) -> Option<&str> { ... }
    fn security_scheme_name(&self) -> Option<&str> { ... }
    fn link_name(&self) -> Option<&str> { ... }
    fn callback_name(&self) -> Option<&str> { ... }
    fn path_item_name(&self) -> Option<&str> { ... }
}
Expand description

Extension trait for openapi::Ref providing helpers to extract component names.

Required Methods§

Source

fn component_name(&self, component: &str) -> Option<&str>

Returns the component name for the given component type if the reference points inside #/components/{component}/....

Source

fn resolve_response<'a>( &self, components: Option<&'a Components>, ) -> Option<&'a Response>

Resolve the referenced response from the supplied OpenAPI components.

Provided Methods§

Source

fn schema_name(&self) -> Option<&str>

Returns the referenced schema name if the reference points to #/components/schemas/....

Source

fn response_name(&self) -> Option<&str>

Returns the referenced response name if the reference points to #/components/responses/....

Source

fn parameter_name(&self) -> Option<&str>

Returns the referenced parameter name if the reference points to #/components/parameters/....

Source

fn example_name(&self) -> Option<&str>

Returns the referenced example name if the reference points to #/components/examples/....

Source

fn request_body_name(&self) -> Option<&str>

Returns the referenced request body name if the reference points to #/components/requestBodies/....

Source

fn header_name(&self) -> Option<&str>

Returns the referenced header name if the reference points to #/components/headers/....

Source

fn security_scheme_name(&self) -> Option<&str>

Returns the referenced security scheme name if the reference points to #/components/securitySchemes/....

Returns the referenced link name if the reference points to #/components/links/....

Source

fn callback_name(&self) -> Option<&str>

Returns the referenced callback name if the reference points to #/components/callbacks/....

Source

fn path_item_name(&self) -> Option<&str>

Returns the referenced path item name if the reference points to #/components/pathItems/....

Implementations on Foreign Types§

Source§

impl OpenApiRefExt for Ref

Source§

fn component_name(&self, component: &str) -> Option<&str>

Source§

fn resolve_response<'a>( &self, components: Option<&'a Components>, ) -> Option<&'a Response>

Implementors§