[][src]Struct jsona_openapi_spec::Schema

pub struct Schema {
    pub ref_path: Option<String>,
    pub schema_type: Option<String>,
    pub format: Option<String>,
    pub description: Option<String>,
    pub items: Option<Box<Schema>>,
    pub properties: Option<IndexMap<String, Schema>>,
    pub title: Option<String>,
    pub default: Option<Value>,
    pub required: Option<Vec<String>>,
    pub read_only: Option<bool>,
    pub example: Option<Value>,
    pub enum_values: Option<Vec<String>>,
    pub nullable: Option<bool>,
    pub additional_properties: Option<Box<Schema>>,
    pub all_of: Option<Vec<Schema>>,
    pub one_of: Option<Vec<Schema>>,
    pub any_of: Option<Vec<Schema>>,
    pub not: Option<Vec<Schema>>,
    pub max_length: Option<u32>,
    pub min_length: Option<u32>,
    pub extensions: IndexMap<String, String>,
    pub multiple_of: Option<f64>,
    pub maximum: Option<f64>,
    pub exclusive_maximum: Option<bool>,
    pub minimum: Option<f64>,
    pub exclusive_minimum: Option<bool>,
    pub pattern: Option<String>,
    pub max_items: Option<u32>,
    pub min_items: Option<u32>,
    pub unique_items: Option<bool>,
    pub max_properties: Option<u32>,
    pub min_properties: Option<u32>,
    pub enum_: Option<Vec<Value>>,
}

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: Option<String>

JSON reference path to another definition

schema_type: Option<String>format: Option<String>description: Option<String>items: Option<Box<Schema>>properties: Option<IndexMap<String, Schema>>title: Option<String>default: Option<Value>required: Option<Vec<String>>read_only: Option<bool>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]

enum_values: Option<Vec<String>>nullable: Option<bool>additional_properties: Option<Box<Schema>>

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.

all_of: Option<Vec<Schema>>

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

one_of: Option<Vec<Schema>>

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

any_of: Option<Vec<Schema>>

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

not: Option<Vec<Schema>>

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

max_length: Option<u32>min_length: Option<u32>extensions: IndexMap<String, String>multiple_of: Option<f64>maximum: Option<f64>exclusive_maximum: Option<bool>minimum: Option<f64>exclusive_minimum: Option<bool>pattern: Option<String>max_items: Option<u32>min_items: Option<u32>unique_items: Option<bool>max_properties: Option<u32>min_properties: Option<u32>enum_: Option<Vec<Value>>

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, U> Into<U> for T where
    U: From<T>, 
[src]

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.