#[non_exhaustive]pub enum Schema {
Array(Array),
Object(Object),
OneOf(OneOf),
AllOf(AllOf),
AnyOf(AnyOf),
}Expand description
Is super type for OpenAPI Schema Object. Schema is reusable resource what can be
referenced from path operations and other components using Ref.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Array(Array)
Defines array schema from another schema. Typically used with
Schema::Object. Slice and Vec types are translated to Schema::Array types.
Object(Object)
Defines object schema. Object is either object holding properties which are other Schemas
or can be a field within the Object.
OneOf(OneOf)
Creates a OneOf type composite Object schema. This schema
is used to map multiple schemas together where API endpoint could return any of them.
Schema::OneOf is created form mixed enum where enum contains various variants.
AllOf(AllOf)
Creates a AllOf type composite Object schema.
AnyOf(AnyOf)
Creates a AnyOf type composite Object schema.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Schema
impl<'de> Deserialize<'de> for Schema
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Schema, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
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
Source§impl From<AllOfBuilder> for Schema
impl From<AllOfBuilder> for Schema
Source§fn from(builder: AllOfBuilder) -> Schema
fn from(builder: AllOfBuilder) -> Schema
Converts to this type from the input type.
Source§impl From<AnyOfBuilder> for Schema
impl From<AnyOfBuilder> for Schema
Source§fn from(builder: AnyOfBuilder) -> Schema
fn from(builder: AnyOfBuilder) -> Schema
Converts to this type from the input type.
Source§impl From<ArrayBuilder> for Schema
impl From<ArrayBuilder> for Schema
Source§fn from(builder: ArrayBuilder) -> Schema
fn from(builder: ArrayBuilder) -> Schema
Converts to this type from the input type.
Source§impl From<ObjectBuilder> for Schema
impl From<ObjectBuilder> for Schema
Source§fn from(builder: ObjectBuilder) -> Schema
fn from(builder: ObjectBuilder) -> Schema
Converts to this type from the input type.
Source§impl From<OneOfBuilder> for Schema
impl From<OneOfBuilder> for Schema
Source§fn from(builder: OneOfBuilder) -> Schema
fn from(builder: OneOfBuilder) -> Schema
Converts to this type from the input type.
Source§impl Serialize for Schema
impl Serialize for Schema
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
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
Mutably borrows from an owned value. Read more