pub struct Operation {
pub tags: Option<Vec<String>>,
pub summary: Option<String>,
pub description: Option<String>,
pub operation_id: Option<String>,
pub parameters: Option<Vec<Parameter>>,
pub request_body: Option<RequestBody>,
pub responses: BTreeMap<String, Response>,
}Expand description
操作定义
Fields§
操作标签
summary: Option<String>操作摘要
description: Option<String>操作描述
operation_id: Option<String>操作 ID
parameters: Option<Vec<Parameter>>参数列表
request_body: Option<RequestBody>请求体
responses: BTreeMap<String, Response>响应定义
Implementations§
Source§impl Operation
impl Operation
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
设置描述
Sourcepub fn operation_id(self, id: impl Into<String>) -> Self
pub fn operation_id(self, id: impl Into<String>) -> Self
设置操作 ID
Sourcepub fn request_body(self, body: RequestBody) -> Self
pub fn request_body(self, body: RequestBody) -> Self
设置请求体
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Operation
impl<'de> Deserialize<'de> for Operation
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 Operation
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnsafeUnpin for Operation
impl UnwindSafe for Operation
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