pub struct OneOf {
pub items: Vec<RefOr<Schema>>,
pub schema_type: SchemaType,
pub title: Option<String>,
pub description: Option<String>,
pub default: Option<Value>,
pub example: Option<Value>,
pub examples: Vec<Value>,
pub discriminator: Option<Discriminator>,
pub extensions: Option<Extensions>,
}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.
schema_type: SchemaTypeType of OneOf e.g. SchemaType::new(Type::Object) for object.
By default this is SchemaType::AnyValue as the type is defined by items
themselves.
title: Option<String>Changes the OneOf title.
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.
Deprecated since 3.0.x. Prefer OneOf::examples instead
examples: Vec<Value>Examples 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.
extensions: Option<Extensions>Optional extensions x-something.
Implementations§
Source§impl OneOf
impl OneOf
Sourcepub fn builder() -> OneOfBuilder
pub fn builder() -> OneOfBuilder
Construct a new OneOfBuilder.
This is effectively same as calling OneOfBuilder::new