oapi/objects/
operation.rs

1use super::*;
2
3/// ## The OpenApi [operation object](https://swagger.io/specification/#operation-object)
4#[derive(
5    Debug, PartialEq, Serialize, Deserialize, Clone, Getters, Sparsable, OApiCheck, OApiExt,
6)]
7#[getset(get = "pub")]
8#[serde(rename_all = "camelCase")]
9pub struct OApiOperation {
10    /// The tags this operation corresponds to
11    #[serde(default)]
12    tags: Vec<String>,
13    /// A summary of the operation
14    #[serde(default)]
15    summary: Option<String>,
16    /// A description of the operation
17    #[serde(default)]
18    description: Option<String>,
19    /// An external documentation for this operation
20    external_docs: Option<OApiExternalDocumentation>,
21    /// An unique operation id
22    #[serde(default)]
23    operation_id: Option<String>,
24    /// Parameters for the operations
25    #[serde(default)]
26    parameters: Vec<SparseSelector<OApiParameter>>,
27    /// A request body object
28    request_body: Option<SparseSelector<OApiRequestBody>>,
29    /// A map of responses
30    #[serde(default)]
31    responses: HashMap<String, SparseSelector<OApiResponse>>,
32    /// A map of callbacks
33    #[serde(default)]
34    callbacks: HashMap<String, SparseSelector<OApiCallback>>,
35    /// Flag marking an operation as deprecated
36    #[serde(default)]
37    deprecated: bool,
38    /// A list of security to use
39    #[serde(default)]
40    security: Vec<HashMap<String, Vec<String>>>,
41    /// A list of servers to use
42    #[serde(default)]
43    servers: Vec<OApiServer>,
44    /// Extensions, if any
45    #[serde(flatten)]
46    #[getset(get)]
47    _extension: HashMap<String, Value>,
48}