@@ -5,39 +5,42 @@ use serde::{Deserialize, Serialize};
5
5
/// An object representing a Server.
6
6
///
7
7
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#server-object>.
8
- #[ derive( Clone , Debug , Deserialize , Serialize , PartialEq ) ]
8
+ #[ derive( Debug , Clone , PartialEq , Deserialize , Serialize ) ]
9
9
pub struct Server {
10
- /// A URL to the target host. This URL supports Server Variables and MAY be relative, to
11
- /// indicate that the host location is relative to the location where the OpenAPI document
12
- /// is being served. Variable substitutions will be made when a variable is named
13
- /// in {brackets}.
10
+ /// A URL to the target host.
11
+ ///
12
+ /// This URL supports Server Variables and MAY be relative, to indicate that the host location
13
+ /// is relative to the location where the OpenAPI document is being served. Variable
14
+ /// substitutions will be made when a variable is named in {brackets}.
14
15
pub url : String ,
15
16
16
- /// An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation.
17
+ /// An optional string describing the host designated by the URL.
18
+ ///
19
+ /// CommonMark syntax MAY be used for rich text representation.
17
20
#[ serde( skip_serializing_if = "Option::is_none" ) ]
18
21
pub description : Option < String > ,
19
22
20
- /// A map between a variable name and its value. The value is used for substitution in
21
- /// the server's URL template.
22
- # [ serde ( default ) ]
23
- #[ serde( skip_serializing_if = "BTreeMap::is_empty" ) ]
23
+ /// A map between a variable name and its value.
24
+ ///
25
+ /// The value is used for substitution in the server's URL template.
26
+ #[ serde( default , skip_serializing_if = "BTreeMap::is_empty" ) ]
24
27
pub variables : BTreeMap < String , ServerVariable > ,
25
28
}
26
29
27
30
/// An object representing a Server Variable for server URL template substitution.
28
31
///
29
32
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#server-variable-object>.
30
- #[ derive( Clone , Debug , Deserialize , Serialize , PartialEq ) ]
33
+ #[ derive( Debug , Clone , PartialEq , Deserialize , Serialize ) ]
31
34
pub struct ServerVariable {
32
35
/// The default value to use for substitution, and to send, if an alternate value is not
33
- /// supplied. Unlike the Schema Object's default, this value MUST be provided by the consumer.
36
+ /// supplied.
37
+ ///
38
+ /// Unlike the Schema Object's default, this value MUST be provided by the consumer.
34
39
pub default : String ,
35
40
36
41
/// An enumeration of string values to be used if the substitution options are from a limited
37
42
/// set.
38
- #[ serde( default ) ]
39
- #[ serde( rename = "enum" ) ]
40
- #[ serde( skip_serializing_if = "Vec::is_empty" ) ]
43
+ #[ serde( rename = "enum" , default , skip_serializing_if = "Vec::is_empty" ) ]
41
44
pub substitutions_enum : Vec < String > ,
42
45
43
46
/// An optional description for the server variable. [CommonMark] syntax MAY be used for rich
0 commit comments