pub struct OpenApiSchema {
pub openapi: String,
pub info: Option<Value>,
pub paths: Paths,
pub components: Option<Value>,
pub security: Option<Value>,
}
Expand description
OpenAPI schema
This is the main schema for the OpenAPI specification.
Fields§
§openapi: String
The OpenAPI version
This is the version of the OpenAPI specification.
info: Option<Value>
The info
This is the info of the OpenAPI specification.
paths: Paths
The paths
This is the paths of the OpenAPI specification.
Paths are indexed by route and method.
Example:
{
"/path/to/route": {
"get": {
"operationId": "get_record"
},
"post": {
"operationId": "create_record"
}
}
}
components: Option<Value>
The components
This is the components of the OpenAPI specification.
security: Option<Value>
The security
This is the security of the OpenAPI specification.
Implementations§
Source§impl OpenApiSchema
impl OpenApiSchema
pub fn load_doc_from_string( content: &str, ) -> Result<OpenApiSchema, MappedErrors>
Sourcepub fn resolve_input_refs_from_operation_id(
&self,
operation_id: &str,
) -> Result<Value, MappedErrors>
pub fn resolve_input_refs_from_operation_id( &self, operation_id: &str, ) -> Result<Value, MappedErrors>
Resolve the input refs
This function resolves the references from input elements like parameters, request bodies, headers, etc.
Client methods should simple call this method with the operation id and the input element name.
Trait Implementations§
Source§impl Clone for OpenApiSchema
impl Clone for OpenApiSchema
Source§fn clone(&self) -> OpenApiSchema
fn clone(&self) -> OpenApiSchema
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for OpenApiSchema
impl Debug for OpenApiSchema
Source§impl<'de> Deserialize<'de> for OpenApiSchema
impl<'de> Deserialize<'de> for OpenApiSchema
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for OpenApiSchema
impl PartialEq for OpenApiSchema
Source§impl Serialize for OpenApiSchema
impl Serialize for OpenApiSchema
impl Eq for OpenApiSchema
impl StructuralPartialEq for OpenApiSchema
Auto Trait Implementations§
impl Freeze for OpenApiSchema
impl RefUnwindSafe for OpenApiSchema
impl Send for OpenApiSchema
impl Sync for OpenApiSchema
impl Unpin for OpenApiSchema
impl UnwindSafe for OpenApiSchema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.