pub struct Schema {Show 22 fields
pub min_items: Option<String>,
pub example: Option<Value>,
pub property_ordering: Option<Vec<String>>,
pub pattern: Option<String>,
pub minimum: Option<f64>,
pub default: Option<Value>,
pub any_of: Option<Vec<Schema>>,
pub max_length: Option<String>,
pub title: Option<String>,
pub min_length: Option<String>,
pub min_properties: Option<String>,
pub max_items: Option<String>,
pub maximum: Option<f64>,
pub nullable: Option<bool>,
pub max_properties: Option<String>,
pub type: Option<Type>,
pub description: Option<String>,
pub enum: Option<Vec<String>>,
pub format: Option<String>,
pub items: Option<Box<Schema>>,
pub properties: Option<HashMap<String, Schema>>,
pub required: Option<Vec<String>>,
}Expand description
Schema that defines the format of input and output data. Represents a select subset of an OpenAPI 3.0 schema object.
Fields§
§min_items: Option<String>Optional. Minimum number of elements for Type.ARRAY.
example: Option<Value>Optional. Example of the object.
property_ordering: Option<Vec<String>>Optional. The order of the properties.
pattern: Option<String>Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
minimum: Option<f64>Optional. Minimum value of the Type.INTEGER and Type.NUMBER.
default: Option<Value>Optional. Default value of the data.
any_of: Option<Vec<Schema>>Optional. The value should be validated against any of the subschemas.
max_length: Option<String>Optional. Maximum length of the Type.STRING.
title: Option<String>Optional. The title of the Schema.
min_length: Option<String>Optional. Minimum length of the Type.STRING.
min_properties: Option<String>Optional. Minimum number of properties for Type.OBJECT.
max_items: Option<String>Optional. Maximum number of elements for Type.ARRAY.
maximum: Option<f64>Optional. Maximum value of the Type.INTEGER and Type.NUMBER.
nullable: Option<bool>Optional. Indicates if the value may be null.
max_properties: Option<String>Optional. Maximum number of properties for Type.OBJECT.
type: Option<Type>Optional. The type of the data.
description: Option<String>Optional. The description of the data.
enum: Option<Vec<String>>Optional. Possible values of the element of primitive type with enum format.
format: Option<String>Optional. The format of the data.
items: Option<Box<Schema>>Optional. Schema of the elements of Type.ARRAY.
properties: Option<HashMap<String, Schema>>Optional. Properties of Type.OBJECT.
required: Option<Vec<String>>Optional. Required properties of Type.OBJECT.
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn min_items(self, value: impl Into<String>) -> Self
pub fn min_items(self, value: impl Into<String>) -> Self
Sets the min_items field of this struct.
Sourcepub fn property_ordering(self, value: impl Into<Vec<String>>) -> Self
pub fn property_ordering(self, value: impl Into<Vec<String>>) -> Self
Sets the property_ordering field of this struct.
Sourcepub fn any_of(self, value: impl Into<Vec<Schema>>) -> Self
pub fn any_of(self, value: impl Into<Vec<Schema>>) -> Self
Sets the any_of field of this struct.
Sourcepub fn max_length(self, value: impl Into<String>) -> Self
pub fn max_length(self, value: impl Into<String>) -> Self
Sets the max_length field of this struct.
Sourcepub fn min_length(self, value: impl Into<String>) -> Self
pub fn min_length(self, value: impl Into<String>) -> Self
Sets the min_length field of this struct.
Sourcepub fn min_properties(self, value: impl Into<String>) -> Self
pub fn min_properties(self, value: impl Into<String>) -> Self
Sets the min_properties field of this struct.
Sourcepub fn max_items(self, value: impl Into<String>) -> Self
pub fn max_items(self, value: impl Into<String>) -> Self
Sets the max_items field of this struct.
Sourcepub fn max_properties(self, value: impl Into<String>) -> Self
pub fn max_properties(self, value: impl Into<String>) -> Self
Sets the max_properties field of this struct.
Sourcepub fn description(self, value: impl Into<String>) -> Self
pub fn description(self, value: impl Into<String>) -> Self
Sets the description field of this struct.
Sourcepub fn properties(self, value: impl Into<HashMap<String, Schema>>) -> Self
pub fn properties(self, value: impl Into<HashMap<String, Schema>>) -> Self
Sets the properties field of this struct.