#[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 Schema
s
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 complex enum where enum holds other than unit types.
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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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) -> Self
fn from(builder: AllOfBuilder) -> Self
Converts to this type from the input type.
source§impl From<AnyOfBuilder> for Schema
impl From<AnyOfBuilder> for Schema
source§fn from(builder: AnyOfBuilder) -> Self
fn from(builder: AnyOfBuilder) -> Self
Converts to this type from the input type.
source§impl From<ArrayBuilder> for Schema
impl From<ArrayBuilder> for Schema
source§fn from(builder: ArrayBuilder) -> Self
fn from(builder: ArrayBuilder) -> Self
Converts to this type from the input type.
source§impl From<ObjectBuilder> for Schema
impl From<ObjectBuilder> for Schema
source§fn from(builder: ObjectBuilder) -> Self
fn from(builder: ObjectBuilder) -> Self
Converts to this type from the input type.
source§impl From<OneOfBuilder> for Schema
impl From<OneOfBuilder> for Schema
source§fn from(builder: OneOfBuilder) -> Self
fn from(builder: OneOfBuilder) -> Self
Converts to this type from the input type.
source§impl PartialEq for Schema
impl PartialEq 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
Mutably borrows from an owned value. Read more