pub struct ObjectSchema {
pub properties: BTreeMap<String, PropertySchema>,
pub required: Vec<String>,
pub additional_properties: bool,
}Expand description
Schema for objects/mappings
Fields§
§properties: BTreeMap<String, PropertySchema>Properties of this object
required: Vec<String>Required property names
additional_properties: boolWhether additional properties are allowed
Implementations§
Source§impl ObjectSchema
impl ObjectSchema
Sourcepub fn with_property(
self,
name: impl Into<String>,
schema: PropertySchema,
) -> Self
pub fn with_property( self, name: impl Into<String>, schema: PropertySchema, ) -> Self
Add a property
Sourcepub fn no_additional_properties(self) -> Self
pub fn no_additional_properties(self) -> Self
Disallow additional properties
Trait Implementations§
Source§impl Clone for ObjectSchema
impl Clone for ObjectSchema
Source§fn clone(&self) -> ObjectSchema
fn clone(&self) -> ObjectSchema
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 ObjectSchema
impl Debug for ObjectSchema
Auto Trait Implementations§
impl Freeze for ObjectSchema
impl RefUnwindSafe for ObjectSchema
impl Send for ObjectSchema
impl Sync for ObjectSchema
impl Unpin for ObjectSchema
impl UnsafeUnpin for ObjectSchema
impl UnwindSafe for ObjectSchema
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