Struct Parameter

Source
pub struct Parameter {
Show 24 fields pub name: String, pub in: ParamInEnum, pub description: Option<String>, pub required: Option<bool>, pub schema: Option<Schema>, pub type: Option<ParameterType>, pub format: Option<String>, pub allow_empty_value: Option<bool>, pub items: Option<Items>, pub collection_format: Option<String>, pub default: Option<Value>, pub maximum: Option<Number>, pub exclusive_maximum: Option<bool>, pub minimum: Option<Number>, pub exclusive_minimum: Option<bool>, pub max_length: Option<Number>, pub min_length: Option<Number>, pub pattern: Option<String>, pub max_items: Option<Number>, pub min_items: Option<Number>, pub unique_items: Option<bool>, pub enum: Option<Vec<Value>>, pub multiple_of: Option<Number>, pub extensions: Extensions,
}
Expand description

§Parameter

Describes a single operation parameter. see https://swagger.io/specification/v2/#parameter-object.

Fields§

§name: String

The name of the parameter.

§in: ParamInEnum

The location of the parameter. Possible values are “query”, “header”, “path”, “formData” or “body”.

§description: Option<String>

A brief description of the parameter.

§required: Option<bool>

Determines whether this parameter is mandatory. If the parameter is in “path”, this property is required and its value MUST be true. Otherwise, the property MAY be included and its default value is false.

§schema: Option<Schema>

The schema defining the type used for the body parameter. If the parameter is in “body”, this property is required

§type: Option<ParameterType>

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).

§format: Option<String>

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

§allow_empty_value: Option<bool>

Sets the ability to pass empty-valued parameters.

§items: Option<Items>

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

§collection_format: Option<String>

Determines the format of the array if type array is used.

§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.)

§maximum: Option<Number>§exclusive_maximum: Option<bool>§minimum: Option<Number>§exclusive_minimum: Option<bool>§max_length: Option<Number>§min_length: Option<Number>§pattern: Option<String>§max_items: Option<Number>§min_items: Option<Number>§unique_items: Option<bool>§enum: Option<Vec<Value>>§multiple_of: Option<Number>§extensions: Extensions

Trait Implementations§

Source§

impl Clone for Parameter

Source§

fn clone(&self) -> Parameter

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Parameter

Source§

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

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

impl<'de> Deserialize<'de> for Parameter

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 Parameter

Source§

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

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

const 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 Parameter

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 Parameter

Auto Trait Implementations§

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>,