pub struct SchemaDetails {Show 17 fields
pub description: Option<String>,
pub nullable: Option<bool>,
pub recursive_anchor: Option<bool>,
pub enum_values: Option<Vec<Value>>,
pub format: Option<String>,
pub default: Option<Value>,
pub const_value: Option<Value>,
pub properties: Option<BTreeMap<String, Schema>>,
pub required: Option<Vec<String>>,
pub additional_properties: Option<AdditionalProperties>,
pub items: Option<Box<Schema>>,
pub minimum: Option<f64>,
pub maximum: Option<f64>,
pub min_length: Option<u64>,
pub max_length: Option<u64>,
pub pattern: Option<String>,
pub extra: BTreeMap<String, Value>,
}Fields§
§description: Option<String>§nullable: Option<bool>§recursive_anchor: Option<bool>§enum_values: Option<Vec<Value>>§format: Option<String>§default: Option<Value>§const_value: Option<Value>§properties: Option<BTreeMap<String, Schema>>§required: Option<Vec<String>>§additional_properties: Option<AdditionalProperties>§items: Option<Box<Schema>>§minimum: Option<f64>§maximum: Option<f64>§min_length: Option<u64>§max_length: Option<u64>§pattern: Option<String>§extra: BTreeMap<String, Value>Implementations§
Source§impl SchemaDetails
impl SchemaDetails
Sourcepub fn is_nullable(&self) -> bool
pub fn is_nullable(&self) -> bool
Check if this schema is nullable
Sourcepub fn is_string_enum(&self) -> bool
pub fn is_string_enum(&self) -> bool
Check if this is a string enum
Sourcepub fn string_enum_values(&self) -> Option<Vec<String>>
pub fn string_enum_values(&self) -> Option<Vec<String>>
Get enum values as strings if this is a string enum
Sourcepub fn is_field_required(&self, field_name: &str) -> bool
pub fn is_field_required(&self, field_name: &str) -> bool
Check if a field is required
Trait Implementations§
Source§impl Clone for SchemaDetails
impl Clone for SchemaDetails
Source§fn clone(&self) -> SchemaDetails
fn clone(&self) -> SchemaDetails
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 SchemaDetails
impl Debug for SchemaDetails
Source§impl<'de> Deserialize<'de> for SchemaDetails
impl<'de> Deserialize<'de> for SchemaDetails
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 SchemaDetails
impl RefUnwindSafe for SchemaDetails
impl Send for SchemaDetails
impl Sync for SchemaDetails
impl Unpin for SchemaDetails
impl UnwindSafe for SchemaDetails
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