[][src]Struct openapiv3::Discriminator

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

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.

Trait Implementations

impl Default for Discriminator[src]

impl Clone for Discriminator[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<Discriminator> for Discriminator[src]

impl Debug for Discriminator[src]

impl Serialize for Discriminator[src]

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

Auto Trait Implementations

Blanket Implementations

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> From<T> for T[src]

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.

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

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

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

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