pub struct SchemaConfig {
pub nullable_optional: bool,
pub include_examples: bool,
pub custom_mappings: HashMap<String, Schema>,
}Expand description
Configuration for schema generation
Fields§
§nullable_optional: boolGenerate nullable schemas for Option
include_examples: boolInclude example values
custom_mappings: HashMap<String, Schema>Custom type mappings
Implementations§
Source§impl SchemaConfig
impl SchemaConfig
Sourcepub fn with_nullable_optional(self, nullable: bool) -> Self
pub fn with_nullable_optional(self, nullable: bool) -> Self
Set nullable option handling
Sourcepub fn with_examples(self, include: bool) -> Self
pub fn with_examples(self, include: bool) -> Self
Set example inclusion
Sourcepub fn with_custom_mapping(self, type_name: &str, schema: Schema) -> Self
pub fn with_custom_mapping(self, type_name: &str, schema: Schema) -> Self
Add custom type mapping
Trait Implementations§
Source§impl Clone for SchemaConfig
impl Clone for SchemaConfig
Source§fn clone(&self) -> SchemaConfig
fn clone(&self) -> SchemaConfig
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 SchemaConfig
impl Debug for SchemaConfig
Auto Trait Implementations§
impl Freeze for SchemaConfig
impl RefUnwindSafe for SchemaConfig
impl Send for SchemaConfig
impl Sync for SchemaConfig
impl Unpin for SchemaConfig
impl UnwindSafe for SchemaConfig
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