@@ -12,6 +12,8 @@ type Ref struct {
1212 Ref string `json:"$ref" yaml:"$ref"`
1313}
1414
15+ // CallbackRef represents either a Callback or a $ref to a Callback.
16+ // When serializing and both fields are set, Ref is preferred over Value.
1517type CallbackRef struct {
1618 Ref string
1719 Value * Callback
@@ -43,6 +45,8 @@ func (value CallbackRef) JSONLookup(token string) (interface{}, error) {
4345 return ptr , err
4446}
4547
48+ // ExampleRef represents either a Example or a $ref to a Example.
49+ // When serializing and both fields are set, Ref is preferred over Value.
4650type ExampleRef struct {
4751 Ref string
4852 Value * Example
@@ -74,6 +78,8 @@ func (value ExampleRef) JSONLookup(token string) (interface{}, error) {
7478 return ptr , err
7579}
7680
81+ // HeaderRef represents either a Header or a $ref to a Header.
82+ // When serializing and both fields are set, Ref is preferred over Value.
7783type HeaderRef struct {
7884 Ref string
7985 Value * Header
@@ -105,6 +111,8 @@ func (value HeaderRef) JSONLookup(token string) (interface{}, error) {
105111 return ptr , err
106112}
107113
114+ // LinkRef represents either a Link or a $ref to a Link.
115+ // When serializing and both fields are set, Ref is preferred over Value.
108116type LinkRef struct {
109117 Ref string
110118 Value * Link
@@ -125,6 +133,8 @@ func (value *LinkRef) Validate(ctx context.Context) error {
125133 return foundUnresolvedRef (value .Ref )
126134}
127135
136+ // ParameterRef represents either a Parameter or a $ref to a Parameter.
137+ // When serializing and both fields are set, Ref is preferred over Value.
128138type ParameterRef struct {
129139 Ref string
130140 Value * Parameter
@@ -156,6 +166,8 @@ func (value ParameterRef) JSONLookup(token string) (interface{}, error) {
156166 return ptr , err
157167}
158168
169+ // ResponseRef represents either a Response or a $ref to a Response.
170+ // When serializing and both fields are set, Ref is preferred over Value.
159171type ResponseRef struct {
160172 Ref string
161173 Value * Response
@@ -187,6 +199,8 @@ func (value ResponseRef) JSONLookup(token string) (interface{}, error) {
187199 return ptr , err
188200}
189201
202+ // RequestBodyRef represents either a RequestBody or a $ref to a RequestBody.
203+ // When serializing and both fields are set, Ref is preferred over Value.
190204type RequestBodyRef struct {
191205 Ref string
192206 Value * RequestBody
@@ -218,6 +232,8 @@ func (value RequestBodyRef) JSONLookup(token string) (interface{}, error) {
218232 return ptr , err
219233}
220234
235+ // SchemaRef represents either a Schema or a $ref to a Schema.
236+ // When serializing and both fields are set, Ref is preferred over Value.
221237type SchemaRef struct {
222238 Ref string
223239 Value * Schema
@@ -256,6 +272,8 @@ func (value SchemaRef) JSONLookup(token string) (interface{}, error) {
256272 return ptr , err
257273}
258274
275+ // SecuritySchemeRef represents either a SecurityScheme or a $ref to a SecurityScheme.
276+ // When serializing and both fields are set, Ref is preferred over Value.
259277type SecuritySchemeRef struct {
260278 Ref string
261279 Value * SecurityScheme
0 commit comments