Struct rweb::openapi::Schema [−][src]
pub struct Schema {}Show fields
pub ref_path: Cow<'static, str>, pub description: Cow<'static, str>, pub format: Cow<'static, str>, pub items: Option<Box<Schema, Global>>, pub properties: IndexMap<Cow<'static, str>, Schema, RandomState>, pub read_only: Option<bool>, pub write_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 all_of: Vec<ObjectOrReference<Schema>, Global>, pub one_of: Vec<ObjectOrReference<Schema>, Global>, pub any_of: Vec<ObjectOrReference<Schema>, Global>, pub schema_type: Option<Type>, pub enum_values: Vec<Cow<'static, str>, Global>, pub const_value: Option<Value>, pub multiple_of: Option<Value>, pub minimum: Option<Value>, pub exclusive_minimum: Option<Value>, pub maximum: Option<Value>, pub exclusive_maximum: Option<Value>, pub max_length: Option<usize>, pub min_length: Option<usize>, pub pattern: Cow<'static, str>, pub max_items: Option<usize>, pub min_items: Option<usize>, pub unique_items: Option<bool>, pub max_properties: Option<usize>, pub min_properties: Option<usize>, pub required: Vec<Cow<'static, str>, Global>, pub dependent_required: IndexMap<Cow<'static, str>, Vec<Cow<'static, str>, Global>, RandomState>,
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.
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>
format: Cow<'static, str>
items: Option<Box<Schema, Global>>
properties: IndexMap<Cow<'static, str>, Schema, RandomState>
read_only: Option<bool>
write_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
.
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.
any_of: Vec<ObjectOrReference<Schema>, Global>
Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema.
schema_type: Option<Type>
enum_values: Vec<Cow<'static, str>, Global>
const_value: Option<Value>
multiple_of: Option<Value>
minimum: Option<Value>
exclusive_minimum: Option<Value>
maximum: Option<Value>
exclusive_maximum: Option<Value>
max_length: Option<usize>
min_length: Option<usize>
pattern: Cow<'static, str>
max_items: Option<usize>
min_items: Option<usize>
unique_items: Option<bool>
max_properties: Option<usize>
min_properties: Option<usize>
required: Vec<Cow<'static, str>, Global>
dependent_required: IndexMap<Cow<'static, str>, Vec<Cow<'static, str>, Global>, RandomState>
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Schema, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Schema, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Schema
impl UnwindSafe for Schema
Blanket Implementations
Mutably borrows from an owned value. Read more
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V