apistos_models/tag.rs
1use crate::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(any(test, feature = "deserialize"), derive(serde::Deserialize, PartialEq))]
9#[serde(rename_all = "camelCase")]
10pub struct Tag {
11 /// The name of the tag.
12 pub name: String,
13 /// A short description for the tag. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
14 #[serde(skip_serializing_if = "Option::is_none")]
15 pub description: Option<String>,
16 /// Additional external documentation for this tag.
17 #[serde(skip_serializing_if = "Option::is_none")]
18 pub external_docs: Option<ExternalDocumentation>,
19 /// This object MAY be extended with [Specification Extensions](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#specification-extensions).
20 #[serde(flatten, skip_serializing_if = "IndexMap::is_empty", skip_deserializing)]
21 pub extensions: IndexMap<String, Value>,
22}