pub struct JsonSchemaBuilder { /* private fields */ }Expand description
Builder for creating JSON Schema documents with $defs
Implementations§
Source§impl JsonSchemaBuilder
impl JsonSchemaBuilder
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Set the description
Sourcepub fn register<T: ToJsonSchema>(self) -> Self
pub fn register<T: ToJsonSchema>(self) -> Self
Register a type that implements ToJsonSchema
Sourcepub fn add_schema(self, name: impl Into<String>, schema: JsonSchema) -> Self
pub fn add_schema(self, name: impl Into<String>, schema: JsonSchema) -> Self
Add a schema with a custom name
Sourcepub fn build(self) -> JsonSchema
pub fn build(self) -> JsonSchema
Build the final JSON Schema document
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JsonSchemaBuilder
impl RefUnwindSafe for JsonSchemaBuilder
impl Send for JsonSchemaBuilder
impl Sync for JsonSchemaBuilder
impl Unpin for JsonSchemaBuilder
impl UnwindSafe for JsonSchemaBuilder
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