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§
Sourcefn component_name(&self, component: &str) -> Option<&str>
fn component_name(&self, component: &str) -> Option<&str>
Returns the component name for the given component type if the reference points inside #/components/{component}/....
Sourcefn resolve_response<'a>(
&self,
components: Option<&'a Components>,
) -> Option<&'a Response>
fn resolve_response<'a>( &self, components: Option<&'a Components>, ) -> Option<&'a Response>
Resolve the referenced response from the supplied OpenAPI components.
Provided Methods§
Sourcefn schema_name(&self) -> Option<&str>
fn schema_name(&self) -> Option<&str>
Returns the referenced schema name if the reference points to #/components/schemas/....
Sourcefn response_name(&self) -> Option<&str>
fn response_name(&self) -> Option<&str>
Returns the referenced response name if the reference points to #/components/responses/....
Sourcefn parameter_name(&self) -> Option<&str>
fn parameter_name(&self) -> Option<&str>
Returns the referenced parameter name if the reference points to #/components/parameters/....
Sourcefn example_name(&self) -> Option<&str>
fn example_name(&self) -> Option<&str>
Returns the referenced example name if the reference points to #/components/examples/....
Sourcefn request_body_name(&self) -> Option<&str>
fn request_body_name(&self) -> Option<&str>
Returns the referenced request body name if the reference points to #/components/requestBodies/....
Sourcefn header_name(&self) -> Option<&str>
fn header_name(&self) -> Option<&str>
Returns the referenced header name if the reference points to #/components/headers/....
Sourcefn security_scheme_name(&self) -> Option<&str>
fn security_scheme_name(&self) -> Option<&str>
Returns the referenced security scheme name if the reference points to #/components/securitySchemes/....
Sourcefn link_name(&self) -> Option<&str>
fn link_name(&self) -> Option<&str>
Returns the referenced link name if the reference points to #/components/links/....
Sourcefn callback_name(&self) -> Option<&str>
fn callback_name(&self) -> Option<&str>
Returns the referenced callback name if the reference points to #/components/callbacks/....
Sourcefn path_item_name(&self) -> Option<&str>
fn path_item_name(&self) -> Option<&str>
Returns the referenced path item name if the reference points to #/components/pathItems/....