@@ -19,15 +19,16 @@ use super::{spec_extensions, Server};
19
19
/// the linked operation.
20
20
///
21
21
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#link-object>.
22
- #[ derive( Clone , Debug , Deserialize , Serialize , PartialEq ) ]
22
+ #[ derive( Debug , Clone , PartialEq , Deserialize , Serialize ) ]
23
23
#[ serde( untagged) ]
24
24
pub enum Link {
25
- /// A relative or absolute reference to an OAS operation. This field is mutually exclusive
26
- /// of the `operationId` field, and MUST point to an
27
- /// [Operation Object](https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#operation-object).
28
- /// Relative `operationRef` values MAY be used to locate an existing
29
- /// [Operation Object](https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#operation-object)
30
- /// in the OpenAPI definition.
25
+ /// A relative or absolute reference to an OAS operation.
26
+ ///
27
+ /// This field is mutually exclusive of the `operationId` field, and MUST point to an
28
+ /// [Operation Object]. Relative `operationRef` values MAY be used to locate an existing
29
+ /// [Operation Object] in the OpenAPI definition.
30
+ ///
31
+ /// [Operation Object]: https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#operation-object
31
32
Ref {
32
33
#[ serde( rename = "operationRef" ) ]
33
34
operation_ref : String ,
@@ -42,8 +43,7 @@ pub enum Link {
42
43
// /// locations (e.g. path.id).
43
44
// parameters: BTreeMap<String, Any | {expression}>,
44
45
//
45
- #[ serde( default ) ]
46
- #[ serde( skip_serializing_if = "BTreeMap::is_empty" ) ]
46
+ #[ serde( default , skip_serializing_if = "BTreeMap::is_empty" ) ]
47
47
parameters : BTreeMap < String , String > ,
48
48
49
49
// FIXME: Implement
@@ -70,8 +70,11 @@ pub enum Link {
70
70
#[ serde( flatten, with = "spec_extensions" ) ]
71
71
extensions : BTreeMap < String , serde_json:: Value > ,
72
72
} ,
73
+
73
74
/// The name of an _existing_, resolvable OAS operation, as defined with a unique
74
- /// `operationId`. This field is mutually exclusive of the `operationRef` field.
75
+ /// `operationId`.
76
+ ///
77
+ /// This field is mutually exclusive of the `operationRef` field.
75
78
Id {
76
79
#[ serde( rename = "operationId" ) ]
77
80
operation_id : String ,
@@ -86,8 +89,7 @@ pub enum Link {
86
89
// /// locations (e.g. path.id).
87
90
// parameters: BTreeMap<String, Any | {expression}>,
88
91
//
89
- #[ serde( default ) ]
90
- #[ serde( skip_serializing_if = "BTreeMap::is_empty" ) ]
92
+ #[ serde( default , skip_serializing_if = "BTreeMap::is_empty" ) ]
91
93
parameters : BTreeMap < String , String > ,
92
94
93
95
// FIXME: Implement
@@ -96,8 +98,11 @@ pub enum Link {
96
98
// /// to use as a request body when calling the target operation.
97
99
// #[serde(rename = "requestBody")]
98
100
// request_body: Any | {expression}
99
- /// A description of the link. [CommonMark syntax](http://spec.commonmark.org/) MAY be
100
- /// used for rich text representation.
101
+ //
102
+ /// A description of the link.
103
+ ///
104
+ /// [CommonMark syntax](https://spec.commonmark.org) MAY be used for rich text
105
+ /// representation.
101
106
#[ serde( skip_serializing_if = "Option::is_none" ) ]
102
107
description : Option < String > ,
103
108
0 commit comments