#[non_exhaustive]pub struct Array {Show 16 fields
pub schema_type: SchemaType,
pub title: Option<String>,
pub items: ArrayItems,
pub prefix_items: Vec<Schema>,
pub description: Option<String>,
pub deprecated: Option<Deprecated>,
pub example: Option<Value>,
pub examples: Vec<Value>,
pub default: Option<Value>,
pub max_items: Option<usize>,
pub min_items: Option<usize>,
pub unique_items: bool,
pub xml: Option<Xml>,
pub content_encoding: String,
pub content_media_type: String,
pub extensions: Option<Extensions>,
}
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: SchemaType
Type will always be SchemaType::Array
.
title: Option<String>
Changes the Array
title.
items: ArrayItems
Items of the Array
.
prefix_items: Vec<Schema>
Prefix items of Array
is used to define item validation of tuples according JSON schema
item validation.
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.
Deprecated since 3.0.x. Prefer Array::examples
instead
examples: Vec<Value>
Examples 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: bool
Setting this to true
will validate successfully if all elements of this Array
are
unique.
xml: Option<Xml>
Xml format of the array.
content_encoding: String
The content_encoding
keyword specifies the encoding used to store the contents, as specified in
RFC 2054, part 6.1 and [RFC 4648](RFC 2054, part 6.1).
Typically this is either unset for string
content types which then uses the content
encoding of the underlying JSON document. If the content is in binary
format such as an image or an audio
set it to base64
to encode it as Base64
.
See more details at https://json-schema.org/understanding-json-schema/reference/non_json_data#contentencoding
content_media_type: String
The content_media_type
keyword specifies the MIME type of the contents of a string,
as described in RFC 2046.
See more details at https://json-schema.org/understanding-json-schema/reference/non_json_data#contentmediatype
extensions: Option<Extensions>
Optional extensions x-something
.
Implementations§
Source§impl Array
impl Array
Sourcepub fn builder() -> ArrayBuilder
pub fn builder() -> ArrayBuilder
Construct a new ArrayBuilder.
This is effectively same as calling ArrayBuilder::new