pub struct OneOf {
pub items: Vec<RefOr<Schema>>,
pub description: Option<String>,
pub default: Option<Value>,
pub example: Option<Value>,
pub discriminator: Option<Discriminator>,
pub nullable: bool,
}
Expand description
OneOf Composite Object component holds multiple components together where API endpoint could return any of them.
See Schema::OneOf
for more details.
Fields§
§items: Vec<RefOr<Schema>>
Components of OneOf component.
description: Option<String>
Description of the OneOf
. Markdown syntax is supported.
default: Option<Value>
Default value which is provided when user has not provided the input in Swagger UI.
example: Option<Value>
Example shown in UI of the value for richer documentation.
discriminator: Option<Discriminator>
Optional discriminator field can be used to aid deserialization, serialization and validation of a specific schema.
nullable: bool
Set true
to allow "null"
to be used as value for given type.
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for OneOf
impl<'de> Deserialize<'de> for OneOf
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 From<OneOf> for OneOfBuilder
impl From<OneOf> for OneOfBuilder
source§impl From<OneOfBuilder> for OneOf
impl From<OneOfBuilder> for OneOf
source§fn from(value: OneOfBuilder) -> Self
fn from(value: OneOfBuilder) -> Self
Converts to this type from the input type.