aide/openapi/
license.rs

1use indexmap::IndexMap;
2use serde::{Deserialize, Serialize};
3
4/// License information for the exposed API.
5#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, schemars::JsonSchema)]
6pub struct License {
7    /// REQUIRED. The license name used for the API.
8    pub name: String,
9    /// An [SPDX](https://spdx.org/spdx-specification-21-web-version#h.jxpfx0ykyb60) license expression for the API. The `identifier` field is mutually exclusive of the `url` field.
10    #[serde(skip_serializing_if = "Option::is_none")]
11    pub identifier: Option<String>,
12    /// A URL to the license used for the API. This MUST be in the form of a
13    /// URL. The `url` field is mutually exclusive of the `identifier` field.
14    #[serde(skip_serializing_if = "Option::is_none")]
15    pub url: Option<String>,
16    /// Inline extensions to this object.
17    #[serde(flatten, deserialize_with = "crate::util::deserialize_extensions")]
18    pub extensions: IndexMap<String, serde_json::Value>,
19}