[−][src]Struct oas3::Schema
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
description: Option<String>
schema_type: Option<String>
format: Option<String>
enum_values: Vec<String>
required: Vec<String>
items: Option<Box<Schema>>
properties: BTreeMap<String, Schema>
read_only: Option<bool>
additional_properties: Option<ObjectOrReference<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.
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: Option<String>
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>>
Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema.
Trait Implementations
impl FromRef for Schema
[src]
impl Clone for Schema
[src]
fn clone(&self) -> Schema
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for Schema
[src]
impl PartialEq<Schema> for Schema
[src]
impl Debug for Schema
[src]
impl Serialize for Schema
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Schema
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Unpin for Schema
impl Sync for Schema
impl Send for Schema
impl UnwindSafe for Schema
impl RefUnwindSafe for Schema
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,