pub struct OpenApiConfig {
pub openapi_version: String,
pub info: ApiInfo,
pub servers: Vec<ServerConfig>,
pub security_schemes: HashMap<String, SecurityScheme>,
pub tags: Vec<TagConfig>,
pub external_docs: Option<ExternalDocs>,
pub include_examples: bool,
pub nullable_optional: bool,
pub custom_schemas: HashMap<String, String>,
pub export: ExportConfig,
}Expand description
Configuration for OpenAPI specification generation
Fields§
§openapi_version: StringOpenAPI specification version (should be “3.0.3”)
info: ApiInfoAPI information
servers: Vec<ServerConfig>Server configurations
security_schemes: HashMap<String, SecurityScheme>Global security schemes
Global tags for grouping operations
external_docs: Option<ExternalDocs>External documentation
include_examples: boolWhether to include example values in schemas
nullable_optional: boolWhether to generate nullable fields for Option
custom_schemas: HashMap<String, String>Custom schema mappings for specific types
export: ExportConfigExport settings
Implementations§
Source§impl OpenApiConfig
impl OpenApiConfig
Sourcepub fn add_server(self, url: &str, description: Option<&str>) -> Self
pub fn add_server(self, url: &str, description: Option<&str>) -> Self
Add a server configuration
Sourcepub fn add_security_scheme(self, name: &str, scheme: SecurityScheme) -> Self
pub fn add_security_scheme(self, name: &str, scheme: SecurityScheme) -> Self
Add a security scheme
Trait Implementations§
Source§impl Clone for OpenApiConfig
impl Clone for OpenApiConfig
Source§fn clone(&self) -> OpenApiConfig
fn clone(&self) -> OpenApiConfig
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 OpenApiConfig
impl Debug for OpenApiConfig
Source§impl Default for OpenApiConfig
impl Default for OpenApiConfig
Source§impl<'de> Deserialize<'de> for OpenApiConfig
impl<'de> Deserialize<'de> for OpenApiConfig
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
Auto Trait Implementations§
impl Freeze for OpenApiConfig
impl RefUnwindSafe for OpenApiConfig
impl Send for OpenApiConfig
impl Sync for OpenApiConfig
impl Unpin for OpenApiConfig
impl UnwindSafe for OpenApiConfig
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