Struct salvo_oapi::schema::AllOf
source · #[non_exhaustive]pub struct AllOf {
pub items: Vec<RefOr<Schema>>,
pub schema_type: SchemaType,
pub title: Option<String>,
pub description: Option<String>,
pub default_value: Option<Value>,
pub examples: Vec<Value>,
pub discriminator: Option<Discriminator>,
pub extensions: Option<PropMap<String, Value>>,
}Expand description
AllOf Composite Object component holds multiple components together where API endpoint will return a combination of all of them.
See Schema::AllOf for more details.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.items: Vec<RefOr<Schema>>Components of AllOf component.
schema_type: SchemaTypeType of AllOf e.g. SchemaType::basic(BasicType::Object) for object.
By default this is SchemaType::AnyValue as the type is defined by items
themselves.
title: Option<String>Changes the AllOf title.
description: Option<String>Description of the AllOf. Markdown syntax is supported.
default_value: Option<Value>Default value which is provided when user has not provided the input in Swagger UI.
examples: Vec<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.
extensions: Option<PropMap<String, Value>>Optional extensions x-something.
Implementations§
source§impl AllOf
impl AllOf
sourcepub fn new() -> Self
pub fn new() -> Self
Construct a new empty AllOf. This is effectively same as calling AllOf::default.
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
sourcepub fn item<I: Into<RefOr<Schema>>>(self, component: I) -> Self
pub fn item<I: Into<RefOr<Schema>>>(self, component: I) -> Self
Adds a given Schema to AllOf Composite Object
sourcepub fn schema_type<T: Into<SchemaType>>(self, schema_type: T) -> Self
pub fn schema_type<T: Into<SchemaType>>(self, schema_type: T) -> Self
Add or change type of the object e.g. to change type to string
use value SchemaType::Type(Type::String).
sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Add or change optional description for AllOf component.
sourcepub fn default_value(self, default: Value) -> Self
pub fn default_value(self, default: Value) -> Self
Add or change default value for the object which is provided when user has not provided the input in Swagger UI.
sourcepub fn example<V: Into<Value>>(self, example: V) -> Self
pub fn example<V: Into<Value>>(self, example: V) -> Self
Add or change example shown in UI of the value for richer documentation.
sourcepub fn examples<I: IntoIterator<Item = V>, V: Into<Value>>(
self,
examples: I,
) -> Self
pub fn examples<I: IntoIterator<Item = V>, V: Into<Value>>( self, examples: I, ) -> Self
Add or change examples shown in UI of the value for richer documentation.
sourcepub fn discriminator(self, discriminator: Discriminator) -> Self
pub fn discriminator(self, discriminator: Discriminator) -> Self
Add or change discriminator field of the composite AllOf type.
Trait Implementations§
source§impl<'de> Deserialize<'de> for AllOf
impl<'de> Deserialize<'de> for AllOf
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>,
impl StructuralPartialEq for AllOf
Auto Trait Implementations§
impl Freeze for AllOf
impl RefUnwindSafe for AllOf
impl Send for AllOf
impl Sync for AllOf
impl Unpin for AllOf
impl UnwindSafe for AllOf
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)