pub struct Parameter {
pub name: String,
pub location: ParameterLocation,
pub description: Option<String>,
pub required: bool,
pub schema: Option<Schema>,
pub deprecated: bool,
pub allow_empty_value: bool,
pub example: Option<Value>,
pub examples: Option<BTreeMap<String, ExampleOrReference>>,
}Expand description
参数定义
Fields§
§name: String参数名称
location: ParameterLocation参数位置
description: Option<String>参数描述
required: bool是否必需
schema: Option<Schema>参数 Schema
deprecated: bool是否废弃
allow_empty_value: bool是否允许空值
example: Option<Value>示例值
examples: Option<BTreeMap<String, ExampleOrReference>>多个示例
Implementations§
Source§impl Parameter
impl Parameter
创建 Cookie 参数
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
设置描述
Sourcepub fn deprecated(self, deprecated: bool) -> Self
pub fn deprecated(self, deprecated: bool) -> Self
设置废弃
Sourcepub fn allow_empty_value(self, allow: bool) -> Self
pub fn allow_empty_value(self, allow: bool) -> Self
设置允许空值
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Parameter
impl RefUnwindSafe for Parameter
impl Send for Parameter
impl Sync for Parameter
impl Unpin for Parameter
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more