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§
source§impl Clone for Discriminator
impl Clone for Discriminator
source§fn clone(&self) -> Discriminator
fn clone(&self) -> Discriminator
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Discriminator
impl Debug for Discriminator
source§impl Default for Discriminator
impl Default for Discriminator
source§fn default() -> Discriminator
fn default() -> Discriminator
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for Discriminator
impl<'de> Deserialize<'de> for Discriminator
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 PartialEq<Discriminator> for Discriminator
impl PartialEq<Discriminator> for Discriminator
source§fn eq(&self, other: &Discriminator) -> bool
fn eq(&self, other: &Discriminator) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl 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§
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