Struct openapiv3::Operation

source ·
pub struct Operation {
Show 13 fields pub tags: Vec<String>, pub summary: Option<String>, pub description: Option<String>, pub external_docs: Option<ExternalDocumentation>, pub operation_id: Option<String>, pub parameters: Vec<ReferenceOr<Parameter>>, pub request_body: Option<ReferenceOr<RequestBody>>, pub responses: Responses, pub callbacks: IndexMap<String, Callback>, pub deprecated: bool, pub security: Option<Vec<SecurityRequirement>>, pub servers: Vec<Server>, pub extensions: IndexMap<String, Value>,
}
Expand description

Describes a single API operation on a path.

Fields§

§tags: Vec<String>

A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.

§summary: Option<String>

A short summary of what the operation does.

§description: Option<String>

A verbose explanation of the operation behavior. CommonMark syntax MAY be used for rich text representation.

§external_docs: Option<ExternalDocumentation>

Additional external documentation for this operation.

§operation_id: Option<String>

Unique string used to identify the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.

§parameters: Vec<ReferenceOr<Parameter>>

A list of parameters that are applicable for this operation. If a parameter is already defined at the Path Item, the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object’s components/parameters.

§request_body: Option<ReferenceOr<RequestBody>>

The request body applicable for this operation. The requestBody is only supported in HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody SHALL be ignored by consumers.

§responses: Responses

REQUIRED. The list of possible responses as they are returned from executing this operation.

§callbacks: IndexMap<String, Callback>

A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a Callback Object that describes a request that may be initiated by the API provider and the expected responses.

§deprecated: bool

Declares this operation to be deprecated.Default value is false.

§security: Option<Vec<SecurityRequirement>>

A declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. This definition overrides any declared top-level security. To remove a top-level security declaration, an empty array can be used.

§servers: Vec<Server>

An alternative server array to service this operation. If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by this value.

§extensions: IndexMap<String, Value>

Inline extensions to this object.

Trait Implementations§

source§

impl Clone for Operation

source§

fn clone(&self) -> Operation

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Operation

source§

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

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

impl Default for Operation

source§

fn default() -> Operation

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Operation

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 Operation

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Operation

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 Operation

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

§

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

§

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

§

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