restify_openapi/models/
tag.rs

1use crate::models::paths::ExternalDocumentation;
2use indexmap::IndexMap;
3use serde::Serialize;
4use serde_json::Value;
5
6/// Adds metadata to a single tag that is used by the [Operation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#operation-object). It is not mandatory to have a Tag Object per tag defined in the Operation Object instances.
7#[derive(Serialize, Clone, Debug, Default)]
8#[cfg_attr(
9  any(test, feature = "deserialize"),
10  derive(serde::Deserialize, PartialEq)
11)]
12#[serde(rename_all = "camelCase")]
13pub struct Tag {
14  /// The name of the tag.
15  pub name: String,
16  /// A short description for the tag. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
17  #[serde(skip_serializing_if = "Option::is_none")]
18  pub description: Option<String>,
19  /// Additional external documentation for this tag.
20  #[serde(skip_serializing_if = "Option::is_none")]
21  pub external_docs: Option<ExternalDocumentation>,
22  /// This object MAY be extended with [Specification Extensions](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#specification-extensions).
23  #[serde(
24    flatten,
25    skip_serializing_if = "IndexMap::is_empty",
26    skip_deserializing
27  )]
28  pub extensions: IndexMap<String, Value>,
29}