pub struct OpenApiUtils;Expand description
Utility functions for OpenAPI operations
Implementations§
Source§impl OpenApiUtils
impl OpenApiUtils
Sourcepub fn validate_spec(
spec: &OpenApiSpec,
) -> OpenApiResult<Vec<ValidationWarning>>
pub fn validate_spec( spec: &OpenApiSpec, ) -> OpenApiResult<Vec<ValidationWarning>>
Validate an OpenAPI specification
Sourcepub fn save_spec_to_file<P: AsRef<Path>>(
spec: &OpenApiSpec,
path: P,
format: OutputFormat,
pretty: bool,
) -> OpenApiResult<()>
pub fn save_spec_to_file<P: AsRef<Path>>( spec: &OpenApiSpec, path: P, format: OutputFormat, pretty: bool, ) -> OpenApiResult<()>
Save OpenAPI specification to file
Sourcepub fn load_spec_from_file<P: AsRef<Path>>(
path: P,
) -> OpenApiResult<OpenApiSpec>
pub fn load_spec_from_file<P: AsRef<Path>>( path: P, ) -> OpenApiResult<OpenApiSpec>
Load OpenAPI specification from file
Sourcepub fn merge_specs(
base: &mut OpenApiSpec,
other: &OpenApiSpec,
) -> OpenApiResult<()>
pub fn merge_specs( base: &mut OpenApiSpec, other: &OpenApiSpec, ) -> OpenApiResult<()>
Merge two OpenAPI specifications
Sourcepub fn generate_example_from_schema(schema: &Schema) -> OpenApiResult<Value>
pub fn generate_example_from_schema(schema: &Schema) -> OpenApiResult<Value>
Generate example request/response from schema
Sourcepub fn generate_operation_summary(method: &str, path: &str) -> String
pub fn generate_operation_summary(method: &str, path: &str) -> String
Extract operation summary from function name
Auto Trait Implementations§
impl Freeze for OpenApiUtils
impl RefUnwindSafe for OpenApiUtils
impl Send for OpenApiUtils
impl Sync for OpenApiUtils
impl Unpin for OpenApiUtils
impl UnwindSafe for OpenApiUtils
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