#[non_exhaustive]pub struct Operation {Show 13 fields
pub tags: Option<Vec<String>>,
pub parameters: Option<Vec<Parameter>>,
pub responses: Responses,
pub servers: Option<Vec<Server>>,
pub security: Option<Vec<SecurityRequirement>>,
pub summary: Option<String>,
pub description: Option<String>,
pub operation_id: Option<String>,
pub external_docs: Option<ExternalDocs>,
pub request_body: Option<RequestBody>,
pub callbacks: Option<String>,
pub deprecated: Option<Deprecated>,
pub extensions: Option<Extensions>,
}
Expand description
Implements OpenAPI Operation Object object.
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.List of tags used for grouping operations.
parameters: Option<Vec<Parameter>>
List of applicable parameters for this Operation
.
responses: Responses
List of possible responses returned by the Operation
.
servers: Option<Vec<Server>>
§security: Option<Vec<SecurityRequirement>>
Declaration which security mechanisms can be used for for the operation. Only one
SecurityRequirement
must be met.
Security for the Operation
can be set to optional by adding empty security with
SecurityRequirement::default
.
summary: Option<String>
Short summary what Operation
does.
description: Option<String>
Long explanation of Operation
behaviour. Markdown syntax is supported.
operation_id: Option<String>
Unique identifier for the API Operation
. Most typically this is mapped to handler function name.
external_docs: Option<ExternalDocs>
Additional external documentation for this operation.
request_body: Option<RequestBody>
Optional request body for this Operation
.
callbacks: Option<String>
§deprecated: Option<Deprecated>
Define whether the operation is deprecated or not and thus should be avoided consuming.
extensions: Option<Extensions>
Optional extensions “x-something”.
Implementations§
Source§impl Operation
impl Operation
Sourcepub fn builder() -> OperationBuilder
pub fn builder() -> OperationBuilder
Create an instance of Operation
using the builder syntax
Source§impl Operation
impl Operation
Append tag to Operation
tags.
Sourcepub fn parameters<P: Into<Parameter>>(
&mut self,
parameters: impl IntoIterator<Item = P>,
) -> &mut Self
pub fn parameters<P: Into<Parameter>>( &mut self, parameters: impl IntoIterator<Item = P>, ) -> &mut Self
Add or change parameters of the Operation
.
Sourcepub fn parameter(&mut self, parameter: impl Into<Parameter>) -> &mut Self
pub fn parameter(&mut self, parameter: impl Into<Parameter>) -> &mut Self
Append parameter to Operation
parameters.
Sourcepub fn responses<R: Into<RefOr<Response>>, C: Into<String>>(
&mut self,
responses: impl IntoIterator<Item = (C, R)>,
) -> &mut Self
pub fn responses<R: Into<RefOr<Response>>, C: Into<String>>( &mut self, responses: impl IntoIterator<Item = (C, R)>, ) -> &mut Self
Add or change responses of the Operation
.
Sourcepub fn response(
&mut self,
code: impl Into<String>,
response: impl Into<RefOr<Response>>,
) -> &mut Self
pub fn response( &mut self, code: impl Into<String>, response: impl Into<RefOr<Response>>, ) -> &mut Self
Sourcepub fn security(
&mut self,
security: impl Into<SecurityRequirement>,
) -> &mut Self
pub fn security( &mut self, security: impl Into<SecurityRequirement>, ) -> &mut Self
Append SecurityRequirement
to Operation
security requirements.
Sourcepub fn securities<R: Into<SecurityRequirement>>(
&mut self,
securities: impl IntoIterator<Item = R>,
) -> &mut Self
pub fn securities<R: Into<SecurityRequirement>>( &mut self, securities: impl IntoIterator<Item = R>, ) -> &mut Self
Append SecurityRequirement
to Operation
security requirements.