Struct openapiv3::Discriminator
source · [−]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
sourceimpl Clone for Discriminator
impl Clone for Discriminator
sourcefn clone(&self) -> Discriminator
fn clone(&self) -> Discriminator
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for Discriminator
impl Debug for Discriminator
sourceimpl Default for Discriminator
impl Default for Discriminator
sourcefn default() -> Discriminator
fn default() -> Discriminator
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for Discriminator
impl<'de> Deserialize<'de> for Discriminator
sourcefn 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
sourceimpl PartialEq<Discriminator> for Discriminator
impl PartialEq<Discriminator> for Discriminator
sourcefn eq(&self, other: &Discriminator) -> bool
fn eq(&self, other: &Discriminator) -> bool
sourceimpl Serialize for Discriminator
impl Serialize for Discriminator
impl StructuralPartialEq for Discriminator
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more