pub struct Schema {Show 32 fields
pub ref_path: Option<String>,
pub description: Option<String>,
pub schema_type: Option<String>,
pub format: Option<String>,
pub enum_values: Option<Vec<String>>,
pub required: Option<Vec<String>>,
pub items: Option<Box<Schema>>,
pub properties: Option<BTreeMap<String, Schema>>,
pub read_only: Option<bool>,
pub nullable: Option<bool>,
pub additional_properties: Option<BooleanObjectOrReference<Box<Schema>>>,
pub example: Option<Value>,
pub title: Option<String>,
pub multiple_of: Option<u32>,
pub maximum: Option<i32>,
pub exclusive_maximum: Option<bool>,
pub minimum: Option<i32>,
pub exclusive_minimum: Option<bool>,
pub max_length: Option<u32>,
pub min_length: Option<u32>,
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 default: Option<Value>,
pub all_of: Option<Vec<ObjectOrReference<Schema>>>,
pub one_of: Option<Vec<ObjectOrReference<Schema>>>,
pub any_of: Option<Vec<ObjectOrReference<Schema>>>,
pub not: Option<Vec<ObjectOrReference<Schema>>>,
pub extensions: HashMap<String, String>,
}Expand description
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.
Fields§
§ref_path: Option<String>JSON reference path to another definition
description: Option<String>§schema_type: Option<String>§format: Option<String>§enum_values: Option<Vec<String>>§required: Option<Vec<String>>§items: Option<Box<Schema>>§properties: Option<BTreeMap<String, Schema>>§read_only: Option<bool>§nullable: Option<bool>§additional_properties: Option<BooleanObjectOrReference<Box<Schema>>>Value can be boolean or object. Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema.
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/aa91a19c43f8a12c02efa42d64794e396473f3b1/versions/3.0.1.md#data-types]
title: Option<String>§multiple_of: Option<u32>§maximum: Option<i32>§exclusive_maximum: Option<bool>§minimum: Option<i32>§exclusive_minimum: Option<bool>§max_length: Option<u32>§min_length: Option<u32>§pattern: Option<String>§max_items: Option<u32>§min_items: Option<u32>§unique_items: Option<bool>§max_properties: Option<u32>§min_properties: Option<u32>§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.
all_of: Option<Vec<ObjectOrReference<Schema>>>Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema. allOf
one_of: Option<Vec<ObjectOrReference<Schema>>>Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema. oneOf
any_of: Option<Vec<ObjectOrReference<Schema>>>Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema. anyOf
not: Option<Vec<ObjectOrReference<Schema>>>Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema. not
extensions: HashMap<String, String>Trait Implementations§
Source§impl<'de> Deserialize<'de> for Schema
impl<'de> Deserialize<'de> for Schema
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>,
impl Eq for Schema
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> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.