sw4rm_rs/shared/
tag.rs

1use std::collections::HashMap;
2use serde::{Deserialize, Serialize};
3use serde_json::Value;
4
5use crate::shared::ExternalDocumentation;
6
7/// Tag Object
8///
9/// Allows adding metadata to a single tag that is used by the Operation Object. It is not
10/// mandatory to have a Tag Object per tag used there.
11#[derive(Debug, Serialize, Deserialize, Default, Clone, PartialEq)]
12#[serde(default, rename_all = "camelCase")]
13pub struct Tag {
14    /// Required. The name of the tag.
15    pub name: String,
16    /// A short description for the tag. GFM syntax can 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
23    /// Allows extensions to the Swagger Schema. The field name MUST begin with x-, for example,
24    /// x-internal-id. The value can be null, a primitive, an array or an object. See Vendor
25    /// Extensions for further details.
26    #[serde(flatten, skip_serializing_if = "HashMap::is_empty")]
27    pub x_fields: HashMap<String, Value>,
28}