#[non_exhaustive]pub struct Parameter {
pub name: String,
pub parameter_in: ParameterIn,
pub description: Option<String>,
pub required: Required,
pub deprecated: Option<Deprecated>,
pub schema: Option<RefOr<Schema>>,
pub style: Option<ParameterStyle>,
pub explode: Option<bool>,
pub allow_reserved: Option<bool>,
pub extensions: Option<Extensions>,
/* private fields */
}
Expand description
Implements OpenAPI Parameter Object for Operation
.
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.name: String
Name of the parameter.
- For
ParameterIn::Path
this must in accordance to path templating. - For
ParameterIn::Query
Content-Type
orAuthorization
value will be ignored.
parameter_in: ParameterIn
Parameter location.
description: Option<String>
Markdown supported description of the parameter.
required: Required
Declares whether the parameter is required or not for api.
- For
ParameterIn::Path
this must and will beRequired::True
.
deprecated: Option<Deprecated>
Declares the parameter deprecated status.
schema: Option<RefOr<Schema>>
Schema of the parameter. Typically Schema::Object
is used.
style: Option<ParameterStyle>
Describes how Parameter
is being serialized depending on Parameter::schema
(type of a content).
Default value is based on ParameterIn
.
explode: Option<bool>
When true
it will generate separate parameter value for each parameter with array
and object
type.
This is also true
by default for ParameterStyle::Form
.
With explode false
:
color=blue,black,brown
With explode true
:
color=blue&color=black&color=brown
allow_reserved: Option<bool>
Defines whether parameter should allow reserved characters defined by
RFC3986 :/?#[]@!$&'()*+,;=
.
This is only applicable with ParameterIn::Query
. Default value is false
.
extensions: Option<Extensions>
Optional extensions “x-something”.
Implementations§
Source§impl Parameter
impl Parameter
Sourcepub fn builder() -> ParameterBuilder
pub fn builder() -> ParameterBuilder
Construct a new ParameterBuilder.
This is effectively same as calling ParameterBuilder::new
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Parameter
impl<'de> Deserialize<'de> for Parameter
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<Parameter> for ParameterBuilder
impl From<Parameter> for ParameterBuilder
Source§impl From<ParameterBuilder> for Parameter
impl From<ParameterBuilder> for Parameter
Source§fn from(value: ParameterBuilder) -> Self
fn from(value: ParameterBuilder) -> Self
impl StructuralPartialEq for Parameter
Auto Trait Implementations§
impl Freeze for Parameter
impl RefUnwindSafe for Parameter
impl Send for Parameter
impl Sync for Parameter
impl Unpin for Parameter
impl UnwindSafe for Parameter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)