#[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 examples: Vec<Value>,
pub default_value: Option<Value>,
pub max_items: Option<usize>,
pub min_items: Option<usize>,
pub unique_items: bool,
pub xml: Option<Xml>,
pub extensions: BTreeMap<String, Value>,
}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.
examples: Vec<Value>Examples shown in UI of the value for richer documentation.
default_value: 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.
extensions: BTreeMap<String, Value>Optional extensions x-something.
Implementations§
Source§impl Array
impl Array
Sourcepub fn schema_type<T>(self, schema_type: T) -> Arraywhere
T: Into<SchemaType>,
pub fn schema_type<T>(self, schema_type: T) -> Arraywhere
T: Into<SchemaType>,
Change type of the array e.g. to change type to string
use value SchemaType::Type(Type::String).
§Examples
Make nullable string array.
let _ = Array::new()
.schema_type(SchemaType::from_iter([BasicType::Array, BasicType::Null]))
.items(Object::with_type(BasicType::String));Sourcepub fn description(self, description: impl Into<String>) -> Array
pub fn description(self, description: impl Into<String>) -> Array
Add or change description of the property. Markdown syntax is supported.
Sourcepub fn deprecated(self, deprecated: Deprecated) -> Array
pub fn deprecated(self, deprecated: Deprecated) -> Array
Add or change deprecated status for Array.
Sourcepub fn example<V>(self, example: V) -> Array
pub fn example<V>(self, example: V) -> Array
Add or change example shown in UI of the value for richer documentation.
Sourcepub fn examples<I, V>(self, examples: I) -> Array
pub fn examples<I, V>(self, examples: I) -> Array
Add or change example shown in UI of the value for richer documentation.
Sourcepub fn default_value(self, default: Value) -> Array
pub fn default_value(self, default: Value) -> Array
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) -> Array
pub fn unique_items(self, unique_items: bool) -> Array
Set or change whether Array should enforce all items to be unique.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Array
impl<'de> Deserialize<'de> for Array
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Array, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Array, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Array
impl Serialize for Array
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Array
Auto Trait Implementations§
impl Freeze for Array
impl RefUnwindSafe for Array
impl Send for Array
impl Sync for Array
impl Unpin for Array
impl UnwindSafe for Array
Blanket Implementations§
Source§impl<Data> ApiSuccessResponse for Data
impl<Data> ApiSuccessResponse for Data
fn api_response<Meta>(self, meta: Option<Meta>) -> ApiResponse<Self, Meta>
fn api_response_without_meta<Meta>(self) -> ApiResponse<Self, Meta>
fn api_response_with_meta<Meta>(self, meta: Meta) -> ApiResponse<Self, Meta>
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§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> FutureTraceExt for Twhere
T: FutureExt,
impl<T> FutureTraceExt for Twhere
T: FutureExt,
Source§fn with_current_context_span(self, otel_span: Span) -> WithContext<Self> ⓘ
fn with_current_context_span(self, otel_span: Span) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request