use derive_more::{Display, Error, From};
use serde::{Deserialize, Serialize};
use url::Url;
use super::{Contact, License};
/// General information about the API.
///
///
/// See <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#infoObject>.
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Default)]
// #[serde(rename_all = "lowercase")]
pub struct Info {
/// The title of the application.
pub title: String,
/// A short description of the application. CommonMark syntax MAY be used for rich text representation.
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// A URL to the Terms of Service for the API. MUST be in the format of a URL.
#[serde(rename = "termsOfService", skip_serializing_if = "Option::is_none")]
pub terms_of_service: Option<Url>,
/// The version of the OpenAPI document (which is distinct from the [OpenAPI Specification
/// version](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#oasVersion)
/// or the API implementation version).
pub version: String,
/// The contact information for the exposed API.
#[serde(skip_serializing_if = "Option::is_none")]
pub contact: Option<Contact>,
/// The license information for the exposed API.
#[serde(skip_serializing_if = "Option::is_none")]
pub license: Option<License>,
}