oas3 0.21.0

Structures and tools to parse, navigate, and validate OpenAPI v3.1.xß specifications
Documentation
use std::collections::BTreeMap;

use serde::{Deserialize, Serialize};

use super::spec_extensions;

/// Adds metadata to a single tag that is used by the [Operation Object].
///
/// It is not mandatory to have a Tag Object per tag defined in the Operation Object instances.
///
/// See <https://spec.openapis.org/oas/v3.1.1#tag-object>.
///
/// [Operation Object]: https://spec.openapis.org/oas/v3.1.1#operation-object
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
pub struct Tag {
    /// The name of the tag.
    pub name: String,

    /// A short description for the tag.
    /// [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,

    //
    // /// Additional external documentation for this tag.
    // #[serde(default)]
    // #[serde(skip_serializing_if = "Vec::is_empty")]
    // pub external_docs: Vec<ExternalDoc>,
    //
    /// Specification extensions.
    ///
    /// Only "x-" prefixed keys are collected, and the prefix is stripped.
    ///
    /// See <https://spec.openapis.org/oas/v3.1.1#specification-extensions>.
    #[serde(flatten, with = "spec_extensions")]
    pub extensions: BTreeMap<String, serde_json::Value>,
}