SchemaField

Struct SchemaField 

Source
pub struct SchemaField {
Show 25 fields pub type: FieldType, pub required: Option<bool>, pub uri: Option<String>, pub pattern: Option<String>, pub enum: Option<Vec<Value>>, pub properties: Option<HashMap<String, SchemaField>>, pub items: Option<Box<SchemaField>>, pub title: Option<String>, pub description: Option<String>, pub minimum: Option<f64>, pub maximum: Option<f64>, pub exclusive_minimum: Option<f64>, pub exclusive_maximum: Option<f64>, pub multiple_of: Option<f64>, pub min_length: Option<usize>, pub max_length: Option<usize>, pub format: Option<StringFormat>, pub min_items: Option<usize>, pub max_items: Option<usize>, pub unique_items: Option<bool>, pub additional_properties: Option<bool>, pub default: Option<Value>, pub examples: Option<Vec<Value>>, pub const: Option<Value>, pub deprecated: Option<bool>,
}
Expand description

Schema field definition

Fields§

§type: FieldType

Field type

§required: Option<bool>

Whether the field is required

§uri: Option<String>

For ref types, the URI with optional version operators

§pattern: Option<String>

Pattern for string validation

§enum: Option<Vec<Value>>

Enumeration of allowed values

§properties: Option<HashMap<String, SchemaField>>

For objects, property definitions

§items: Option<Box<SchemaField>>

For arrays, item schema

§title: Option<String>

Human-readable title for the field

§description: Option<String>

Field description

§minimum: Option<f64>

Minimum value (inclusive) for numeric types

§maximum: Option<f64>

Maximum value (inclusive) for numeric types

§exclusive_minimum: Option<f64>

Minimum value (exclusive) for numeric types

§exclusive_maximum: Option<f64>

Maximum value (exclusive) for numeric types

§multiple_of: Option<f64>

Number must be a multiple of this value

§min_length: Option<usize>

Minimum string length

§max_length: Option<usize>

Maximum string length

§format: Option<StringFormat>

Predefined format for string validation

§min_items: Option<usize>

Minimum number of array items

§max_items: Option<usize>

Maximum number of array items

§unique_items: Option<bool>

Whether array items must be unique

§additional_properties: Option<bool>

Whether additional properties are allowed in objects

§default: Option<Value>

Default value for the field

§examples: Option<Vec<Value>>

Example values

§const: Option<Value>

Field must have this exact value

§deprecated: Option<bool>

Whether this field is deprecated

Trait Implementations§

Source§

impl Clone for SchemaField

Source§

fn clone(&self) -> SchemaField

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SchemaField

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SchemaField

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for SchemaField

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,