openapiv3/
server.rs

1use crate::*;
2use indexmap::IndexMap;
3use serde::{Deserialize, Serialize};
4
5/// An object representing a Server.
6#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)]
7pub struct Server {
8    /// REQUIRED. A URL to the target host.
9    /// This URL supports Server Variables and MAY be relative,
10    /// to indicate that the host location is relative to the
11    /// location where the OpenAPI document is being served.
12    /// Variable substitutions will be made when a variable
13    /// is named in {brackets}.
14    pub url: String,
15    /// An optional string describing the host designated
16    /// by the URL. CommonMark syntax MAY be used for rich
17    /// text representation.
18    #[serde(skip_serializing_if = "Option::is_none")]
19    pub description: Option<String>,
20    /// A map between a variable name and its value.
21    /// The value is used for substitution in the server's URL template.
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub variables: Option<IndexMap<String, ServerVariable>>,
24    /// Inline extensions to this object.
25    #[serde(flatten, deserialize_with = "crate::util::deserialize_extensions")]
26    pub extensions: IndexMap<String, serde_json::Value>,
27}