Struct salvo_oapi::schema::Array
source · #[non_exhaustive]pub struct Array {
pub schema_type: SchemaType,
pub title: Option<String>,
pub items: Box<RefOr<Schema>>,
pub description: Option<String>,
pub deprecated: Option<Deprecated>,
pub example: Option<Value>,
pub default: Option<Value>,
pub max_items: Option<usize>,
pub min_items: Option<usize>,
pub unique_items: bool,
pub xml: Option<Xml>,
pub nullable: bool,
}Expand description
Array represents Vec or slice type of items.
See Schema::Array 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.schema_type: SchemaTypeType will always be SchemaType::Array
title: Option<String>Changes the Array title.
items: Box<RefOr<Schema>>Schema representing the array items type.
description: Option<String>Description of the Array. Markdown syntax is supported.
deprecated: Option<Deprecated>Marks the Array deprecated.
example: Option<Value>Example shown in UI of the value for richer documentation.
default: Option<Value>Default value which is provided when user has not provided the input in Swagger UI.
max_items: Option<usize>Max length of the array.
min_items: Option<usize>Min length of the array.
unique_items: boolSetting this to true will validate successfully if all elements of this Array are
unique.
xml: Option<Xml>Xml format of the array.
nullable: boolSet true to allow "null" to be used as value for given type.
Implementations§
source§impl Array
impl Array
sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Add or change description of the property. Markdown syntax is supported.
sourcepub fn deprecated(self, deprecated: Deprecated) -> Self
pub fn deprecated(self, deprecated: Deprecated) -> Self
Add or change deprecated status for Array.
sourcepub fn example(self, example: Value) -> Self
pub fn example(self, example: Value) -> Self
Add or change example shown in UI of the value for richer documentation.
sourcepub fn default(self, default: Value) -> Self
pub fn default(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 unique_items(self, unique_items: bool) -> Self
pub fn unique_items(self, unique_items: bool) -> Self
Set or change whether Array should enforce all items to be unique.