pub struct ArrayBuilder { /* private fields */ }Implementations§
Source§impl ArrayBuilder
impl ArrayBuilder
Sourcepub fn new() -> ArrayBuilder
pub fn new() -> ArrayBuilder
Constructs a new ArrayBuilder.
Source§impl ArrayBuilder
impl ArrayBuilder
Sourcepub fn items<I>(self, items: I) -> ArrayBuilderwhere
I: Into<ArrayItems>,
pub fn items<I>(self, items: I) -> ArrayBuilderwhere
I: Into<ArrayItems>,
Sourcepub fn prefix_items<I, S>(self, items: I) -> ArrayBuilder
pub fn prefix_items<I, S>(self, items: I) -> ArrayBuilder
Add prefix items of Array to define item validation of tuples according JSON schema
item validation.
Sourcepub fn schema_type<T>(self, schema_type: T) -> ArrayBuilderwhere
T: Into<SchemaType>,
pub fn schema_type<T>(self, schema_type: T) -> ArrayBuilderwhere
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 _ = ArrayBuilder::new()
.schema_type(SchemaType::from_iter([Type::Array, Type::Null]))
.items(Object::with_type(Type::String))
.build();Sourcepub fn title<I>(self, title: Option<I>) -> ArrayBuilder
pub fn title<I>(self, title: Option<I>) -> ArrayBuilder
Add or change the title of the Array.
Sourcepub fn description<I>(self, description: Option<I>) -> ArrayBuilder
pub fn description<I>(self, description: Option<I>) -> ArrayBuilder
Add or change description of the property. Markdown syntax is supported.
Sourcepub fn deprecated(self, deprecated: Option<Deprecated>) -> ArrayBuilder
pub fn deprecated(self, deprecated: Option<Deprecated>) -> ArrayBuilder
Add or change deprecated status for Array.
Sourcepub fn example(self, example: Option<Value>) -> ArrayBuilder
👎Deprecated: Since OpenAPI 3.1 prefer using examples
pub fn example(self, example: Option<Value>) -> ArrayBuilder
examplesAdd or change example shown in UI of the value for richer documentation.
Deprecated since 3.0.x. Prefer Array::examples instead
Sourcepub fn examples<I, V>(self, examples: I) -> ArrayBuilder
pub fn examples<I, V>(self, examples: I) -> ArrayBuilder
Add or change examples shown in UI of the value for richer documentation.
Sourcepub fn default(self, default: Option<Value>) -> ArrayBuilder
pub fn default(self, default: Option<Value>) -> ArrayBuilder
Add or change default value for the object which is provided when user has not provided the input in Swagger UI.
Sourcepub fn max_items(self, max_items: Option<usize>) -> ArrayBuilder
pub fn max_items(self, max_items: Option<usize>) -> ArrayBuilder
Set maximum allowed length for Array.
Sourcepub fn min_items(self, min_items: Option<usize>) -> ArrayBuilder
pub fn min_items(self, min_items: Option<usize>) -> ArrayBuilder
Set minimum allowed length for Array.
Sourcepub fn unique_items(self, unique_items: bool) -> ArrayBuilder
pub fn unique_items(self, unique_items: bool) -> ArrayBuilder
Set or change whether Array should enforce all items to be unique.
Sourcepub fn content_encoding<S>(self, content_encoding: S) -> ArrayBuilder
pub fn content_encoding<S>(self, content_encoding: S) -> ArrayBuilder
Set of change Object::content_encoding. Typically left empty but could be base64 for
example.
Sourcepub fn content_media_type<S>(self, content_media_type: S) -> ArrayBuilder
pub fn content_media_type<S>(self, content_media_type: S) -> ArrayBuilder
Set of change Object::content_media_type. Value must be valid MIME type e.g.
application/json.
Sourcepub fn extensions(self, extensions: Option<Extensions>) -> ArrayBuilder
pub fn extensions(self, extensions: Option<Extensions>) -> ArrayBuilder
Add openapi extensions (x-something) for Array.
Sourcepub fn to_array_builder(self) -> ArrayBuilder
pub fn to_array_builder(self) -> ArrayBuilder
Construct a new ArrayBuilder with this component set to ArrayBuilder::items.