Struct openapiv3::Discriminator [−][src]
pub struct Discriminator {
pub property_name: String,
pub mapping: IndexMap<String, String>,
pub extensions: IndexMap<String, Value>,
}
Expand description
When request bodies or response payloads may be one of a number of different schemas, a discriminator object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it.
When using the discriminator, inline schemas will not be considered.
Fields
property_name: String
REQUIRED. The name of the property in the payload that will hold the discriminator value.
mapping: IndexMap<String, String>
An object to hold mappings between payload values and schema names or references.
extensions: IndexMap<String, Value>
Inline extensions to this object.
Trait Implementations
Returns the “default value” for a type. Read more
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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for Discriminator
impl Send for Discriminator
impl Sync for Discriminator
impl Unpin for Discriminator
impl UnwindSafe for Discriminator
Blanket Implementations
Mutably borrows from an owned value. Read more