Struct Schema

Source
pub struct Schema {
Show 35 fields pub title: Option<String>, pub enum: Option<Vec<String>>, pub multiple_of: Option<Number>, pub maximum: Option<Number>, pub exclusive_maximum: Option<bool>, pub minimum: Option<Number>, pub exclusive_minimum: Option<bool>, pub max_length: Option<Number>, pub min_length: Option<Number>, pub pattern: Option<String>, pub max_items: Option<Number>, pub min_items: Option<Number>, pub unique_items: Option<bool>, pub items: Option<Box<RefOrObject<Schema>>>, pub properties: Option<BTreeMap<String, RefOrObject<Schema>>>, pub max_properties: Option<Number>, pub min_properties: Option<Number>, pub required: Option<Vec<String>>, pub type: Option<String>, pub all_of: Option<Vec<Box<RefOrObject<Schema>>>>, pub one_of: Option<Vec<Box<RefOrObject<Schema>>>>, pub any_of: Option<Vec<Box<RefOrObject<Schema>>>>, pub not: Option<Box<RefOrObject<Schema>>>, pub description: Option<String>, pub format: Option<String>, pub default: Option<String>, pub additional_properties: Option<Value>, pub nullable: Option<bool>, pub discriminator: Option<Discriminator>, pub read_only: Option<bool>, pub write_only: Option<bool>, pub xml: Option<XML>, pub external_docs: Option<ExternalDoc>, pub example: Option<Value>, pub deprecated: Option<bool>,
}
Expand description

§Schema

The Schema Object allows the definition of input and output data types. ser https://swagger.io/specification/v3/#schema-object

Fields§

§title: Option<String>§enum: Option<Vec<String>>§multiple_of: Option<Number>§maximum: Option<Number>§exclusive_maximum: Option<bool>§minimum: Option<Number>§exclusive_minimum: Option<bool>§max_length: Option<Number>§min_length: Option<Number>§pattern: Option<String>§max_items: Option<Number>§min_items: Option<Number>§unique_items: Option<bool>§items: Option<Box<RefOrObject<Schema>>>§properties: Option<BTreeMap<String, RefOrObject<Schema>>>§max_properties: Option<Number>§min_properties: Option<Number>§required: Option<Vec<String>>§type: Option<String>§all_of: Option<Vec<Box<RefOrObject<Schema>>>>§one_of: Option<Vec<Box<RefOrObject<Schema>>>>§any_of: Option<Vec<Box<RefOrObject<Schema>>>>§not: Option<Box<RefOrObject<Schema>>>§description: Option<String>§format: Option<String>§default: Option<String>§additional_properties: Option<Value>§nullable: Option<bool>§discriminator: Option<Discriminator>

Adds support for polymorphism.

§read_only: Option<bool>

Relevant only for Schema “properties” definitions.

§write_only: Option<bool>

Relevant only for Schema “properties” definitions.

§xml: Option<XML>

This MAY be used only on properties schemas.

§external_docs: Option<ExternalDoc>

Additional external documentation for this schema.

§example: Option<Value>

A free-form property to include an example of an instance for this schema.

§deprecated: Option<bool>

Specifies that a schema is deprecated and SHOULD be transitioned out of usage.

Trait Implementations§

Source§

impl Clone for Schema

Source§

fn clone(&self) -> Schema

Returns a copy 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 Schema

Source§

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

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

impl<'de> Deserialize<'de> for Schema

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 PartialEq for Schema

Source§

fn eq(&self, other: &Schema) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Schema

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
Source§

impl StructuralPartialEq for Schema

Auto Trait Implementations§

§

impl Freeze for Schema

§

impl RefUnwindSafe for Schema

§

impl Send for Schema

§

impl Sync for Schema

§

impl Unpin for Schema

§

impl UnwindSafe for Schema

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> 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>,