Struct rweb::openapi::Schema[][src]

pub struct Schema {
    pub ref_path: Cow<'static, str>,
    pub description: Cow<'static, str>,
    pub schema_type: Option<Type>,
    pub format: Cow<'static, str>,
    pub enum_values: Vec<Cow<'static, str>, Global>,
    pub required: Vec<Cow<'static, str>, Global>,
    pub items: Option<Box<Schema, Global>>,
    pub properties: IndexMap<Cow<'static, str>, Schema, RandomState>,
    pub read_only: Option<bool>,
    pub nullable: Option<bool>,
    pub additional_properties: Option<ObjectOrReference<Box<Schema, Global>>>,
    pub example: Option<Value>,
    pub title: Cow<'static, str>,
    pub default: Option<Value>,
    pub minimum: Option<Value>,
    pub all_of: Vec<ObjectOrReference<Schema>, Global>,
    pub one_of: Vec<ObjectOrReference<Schema>, Global>,
}

The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is an extended subset of the JSON Schema Specification Wright Draft 00. For more information about the properties, see JSON Schema Core and JSON Schema Validation. Unless stated otherwise, the property definitions follow the JSON Schema.

See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#schemaObject.

Fields

ref_path: Cow<'static, str>

JSON reference path to another definition

description: Cow<'static, str>schema_type: Option<Type>format: Cow<'static, str>enum_values: Vec<Cow<'static, str>, Global>required: Vec<Cow<'static, str>, Global>items: Option<Box<Schema, Global>>properties: IndexMap<Cow<'static, str>, Schema, RandomState>read_only: Option<bool>nullable: Option<bool>additional_properties: Option<ObjectOrReference<Box<Schema, Global>>>

Value can be boolean or object. Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema.

See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#properties.

example: Option<Value>

A free-form property to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary. NOTE: According to [spec], Primitive data types in the OAS are based on the types supported by the JSON Schema Specification Wright Draft 00. This suggest using serde_json::Value. [spec][https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#data-types]

title: Cow<'static, str>default: Option<Value>

The default value represents what would be assumed by the consumer of the input as the value of the schema if one is not provided. Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object defined at the same level. For example, if type is string, then default can be "foo" but cannot be 1.

minimum: Option<Value>all_of: Vec<ObjectOrReference<Schema>, Global>

Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema.

one_of: Vec<ObjectOrReference<Schema>, Global>

Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema.

Trait Implementations

impl Clone for Schema[src]

impl Debug for Schema[src]

impl Default for Schema[src]

impl<'de> Deserialize<'de> for Schema[src]

impl PartialEq<Schema> for Schema[src]

impl Serialize for Schema[src]

impl StructuralPartialEq for Schema[src]

Auto Trait Implementations

impl RefUnwindSafe for Schema

impl Send for Schema

impl Sync for Schema

impl Unpin for Schema

impl UnwindSafe for Schema

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,