pub struct SchemaGenerator { /* private fields */ }Expand description
Generator for JSON schemas with customization options.
Implementations§
Source§impl SchemaGenerator
impl SchemaGenerator
pub fn new() -> Self
pub fn title(self, title: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
pub fn add_property(self, name: impl Into<String>, schema: Value) -> Self
pub fn set_required(self, required: &[String]) -> Self
pub fn set_additional_properties(self, additional: bool) -> Self
pub fn build(self) -> Value
Trait Implementations§
Source§impl Clone for SchemaGenerator
impl Clone for SchemaGenerator
Source§fn clone(&self) -> SchemaGenerator
fn clone(&self) -> SchemaGenerator
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 SchemaGenerator
impl Debug for SchemaGenerator
Source§impl Default for SchemaGenerator
impl Default for SchemaGenerator
Source§fn default() -> SchemaGenerator
fn default() -> SchemaGenerator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SchemaGenerator
impl RefUnwindSafe for SchemaGenerator
impl Send for SchemaGenerator
impl Sync for SchemaGenerator
impl Unpin for SchemaGenerator
impl UnwindSafe for SchemaGenerator
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