pub struct Server {
pub url: String,
pub description: Option<String>,
pub variables: Option<BTreeMap<String, ServerVariable>>,
pub extensions: Option<BTreeMap<String, Value>>,
}Expand description
An object representing a Server.
Specification example:
servers:
- url: https://{username}.gigantic-server.com:{port}/{basePath}
description: The production API server
variables:
username:
# note! no enum here means it is an open value
default: demo
description: this value is assigned by the service provider, in this example `gigantic-server.com`
port:
enum:
- '8443'
- '443'
default: '8443'
basePath:
# open meaning there is the opportunity to use special base paths as assigned by the provider, default is `v2`
default: v2Fields§
§url: StringRequired A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served. Variable substitutions will be made when a variable is named in {brackets}.
description: Option<String>An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation.
variables: Option<BTreeMap<String, ServerVariable>>A map between a variable name and its value. The value is used for substitution in the server’s URL template.
extensions: Option<BTreeMap<String, Value>>This object MAY be extended with Specification Extensions.
The field name MUST begin with x-, for example, x-internal-id.
The value can be null, a primitive, an array or an object.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Server
impl<'de> Deserialize<'de> for Server
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl ValidateWithContext<Spec> for Server
impl ValidateWithContext<Spec> for Server
impl StructuralPartialEq for Server
Auto Trait Implementations§
impl Freeze for Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnwindSafe for Server
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more