Struct openapiv3::Discriminator[][src]

pub struct Discriminator {
    pub property_name: String,
    pub mapping: IndexMap<String, String>,
    pub extensions: IndexMap<String, Value>,
}

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

impl Clone for Discriminator[src]

impl Debug for Discriminator[src]

impl Default for Discriminator[src]

impl<'de> Deserialize<'de> for Discriminator[src]

impl PartialEq<Discriminator> for Discriminator[src]

impl Serialize for Discriminator[src]

impl StructuralPartialEq for Discriminator[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.