Struct Items

Source
pub struct Items {
Show 18 fields pub schema_type: ParameterSchemaType, pub format: Option<String>, pub items: Option<Box<Items>>, pub collection_format: Option<bool>, pub default: Option<Value>, pub maximum: Option<f64>, pub exclusive_maximum: Option<bool>, pub minimum: Option<f64>, pub exclusive_minimum: Option<bool>, pub max_length: Option<i64>, pub min_length: Option<i64>, pub pattern: Option<String>, pub max_items: Option<i64>, pub min_items: Option<i64>, pub unique_items: Option<bool>, pub enum_values: Vec<Value>, pub multiple_of: Option<i64>, pub x_fields: HashMap<String, Value>,
}
Expand description

Items Object

A limited subset of JSON-Schema’s items object. It is used by parameter definitions that are not located in “body”.

Fields§

§schema_type: ParameterSchemaType

Required. The type of the parameter. Since the parameter is not located at the request body, it is limited to simple types (that is, not an object). The value MUST be one of “string”, “number”, “integer”, “boolean”, “array” or “file”. If type is “file”, the consumes MUST be either “multipart/form-data”, “ application/x-www-form-urlencoded“ or both and the parameter MUST be in “formData”.

§format: Option<String>

The extending format for the previously mentioned type. See Data Type Formats for further details.

§items: Option<Box<Items>>

Required if type is “array”. Describes the type of items in the array.

§collection_format: Option<bool>

Determines the format of the array if type array is used. Possible values are:

  • csv - comma separated values foo,bar.
  • ssv - space separated values foo bar.
  • tsv - tab separated values foo\tbar.
  • pipes - pipe separated values foo|bar.
  • multi - corresponds to multiple parameter instances instead of multiple values for a single instance foo=bar&foo=baz. This is valid only for parameters in “query” or “formData”.

Default value is csv.

§default: Option<Value>

Declares the value of the parameter that the server will use if none is provided, for example a “count” to control the number of results per page might default to 100 if not supplied by the client in the request. (Note: “default” has no meaning for required parameters.) See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. Unlike JSON Schema this value MUST conform to the defined type for this parameter.

§maximum: Option<f64>

See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.

§exclusive_maximum: Option<bool>

See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.

§minimum: Option<f64>

See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.

§exclusive_minimum: Option<bool>

See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.

§max_length: Option<i64>

See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.1.

§min_length: Option<i64>

See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.2.

§pattern: Option<String>

See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3.

§max_items: Option<i64>

See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.2.

§min_items: Option<i64>

See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.3.

§unique_items: Option<bool>

See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.4.

§enum_values: Vec<Value>

See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1.

§multiple_of: Option<i64>

See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.1.

§x_fields: HashMap<String, Value>

Allows extensions to the Swagger Schema. The field name MUST begin with x-, for example, x-internal-id. The value can be null, a primitive, an array or an object. See Vendor Extensions for further details.

Trait Implementations§

Source§

impl Clone for Items

Source§

fn clone(&self) -> Items

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Items

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Items

Source§

fn default() -> Items

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Items
where Items: Default,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Items

Source§

fn eq(&self, other: &Items) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Items

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Items

Auto Trait Implementations§

§

impl Freeze for Items

§

impl RefUnwindSafe for Items

§

impl Send for Items

§

impl Sync for Items

§

impl Unpin for Items

§

impl UnwindSafe for Items

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,