pub struct OpenApiSpec {
pub openapi_version: String,
pub title: String,
pub description: String,
pub api_version: String,
pub paths: Vec<(String, PathItem)>,
/* private fields */
}Expand description
A parsed OpenAPI specification.
Fields§
§openapi_version: StringThe OpenAPI version string (e.g. “3.0.3” or “3.1.0”).
title: StringAPI title from info.title.
description: StringAPI description from info.description.
api_version: StringAPI version from info.version.
paths: Vec<(String, PathItem)>Parsed path items keyed by route path.
Implementations§
Source§impl OpenApiSpec
impl OpenApiSpec
Sourcepub fn parse(input: &str) -> Result<Self>
pub fn parse(input: &str) -> Result<Self>
Parse an OpenAPI spec from a string, auto-detecting JSON vs YAML.
Sourcepub fn from_value(value: Value) -> Result<Self>
pub fn from_value(value: Value) -> Result<Self>
Parse an OpenAPI spec from a serde_json::Value.
Sourcepub fn extensions_for(operation: &Operation) -> ChioExtensions
pub fn extensions_for(operation: &Operation) -> ChioExtensions
Extract Chio extensions from an operation’s raw value.
Trait Implementations§
Source§impl Clone for OpenApiSpec
impl Clone for OpenApiSpec
Source§fn clone(&self) -> OpenApiSpec
fn clone(&self) -> OpenApiSpec
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 moreAuto Trait Implementations§
impl Freeze for OpenApiSpec
impl RefUnwindSafe for OpenApiSpec
impl Send for OpenApiSpec
impl Sync for OpenApiSpec
impl Unpin for OpenApiSpec
impl UnsafeUnpin for OpenApiSpec
impl UnwindSafe for OpenApiSpec
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