@@ -34,6 +34,9 @@ type Spec struct {
3434 // Each tag name in the list MUST be unique.
3535 Tags []Tag `json:"tags,omitempty"`
3636
37+ // Additional external documentation.
38+ ExternalDocs * ExternalDocumentation `json:"externalDocs,omitempty"`
39+
3740 // Raw JSON value. Used by JSON Schema resolver.
3841 Raw []byte `json:"-"`
3942}
@@ -91,8 +94,9 @@ type Example struct {
9194//
9295// https://swagger.io/specification/#tag-object
9396type Tag struct {
94- Name string `json:"name"`
95- Description string `json:"description,omitempty"`
97+ Name string `json:"name"`
98+ Description string `json:"description,omitempty"`
99+ ExternalDocs * ExternalDocumentation `json:"externalDocs,omitempty"`
96100}
97101
98102// Info provides metadata about the API.
@@ -132,8 +136,29 @@ type License struct {
132136
133137// Server represents a Server.
134138type Server struct {
139+ // REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative,
140+ // to indicate that the host location is relative to the location where the OpenAPI document is being served.
141+ // Variable substitutions will be made when a variable is named in {brackets}.
142+ URL string `json:"url"`
143+ // An optional string describing the host designated by the URL.
144+ // CommonMark syntax MAY be used for rich text representation.
145+ Description string `json:"description,omitempty"`
146+ // A map between a variable name and its value. The value is used for substitution in the server's URL template.
147+ Variables map [string ]ServerVariable `json:"variables,omitempty"`
148+ }
149+
150+ // ServerVariable describes an object representing a Server Variable for server URL template substitution.
151+ type ServerVariable struct {
152+ // An enumeration of string values to be used if the substitution options are from a limited set.
153+ //
154+ // The array MUST NOT be empty.
155+ Enum []string `json:"enum,omitempty"`
156+ // REQUIRED. The default value to use for substitution, which SHALL be sent if an alternate value is not supplied.
157+ // Note this behavior is different than the Schema Object’s treatment of default values, because in those
158+ // cases parameter values are optional. If the enum is defined, the value MUST exist in the enum’s values.
159+ Default string `json:"default"`
160+ // An optional description for the server variable. CommonMark syntax MAY be used for rich text representation.
135161 Description string `json:"description,omitempty"`
136- URL string `json:"url"`
137162}
138163
139164// Components hold a set of reusable objects for different aspects of the OAS.
@@ -186,8 +211,10 @@ type Operation struct {
186211 // Tags can be used for logical grouping of operations by resources or any other qualifier.
187212 Tags []string `json:"tags,omitempty"`
188213
189- Summary string `json:"summary,omitempty"`
190- Description string `json:"description,omitempty"`
214+ Summary string `json:"summary,omitempty"`
215+ Description string `json:"description,omitempty"`
216+ ExternalDocs * ExternalDocumentation `json:"externalDocs,omitempty"`
217+
191218 OperationID string `json:"operationId,omitempty"`
192219 Parameters []* Parameter `json:"parameters,omitempty"`
193220 RequestBody * RequestBody `json:"requestBody,omitempty"`
@@ -196,6 +223,14 @@ type Operation struct {
196223 Deprecated bool `json:"deprecated,omitempty"`
197224}
198225
226+ // ExternalDocumentation describes a reference to external resource for extended documentation.
227+ type ExternalDocumentation struct {
228+ // A description of the target documentation. CommonMark syntax MAY be used for rich text representation.
229+ Description string `json:"description,omitempty"`
230+ // REQUIRED. The URL for the target documentation. This MUST be in the form of a URL.
231+ URL string `json:"url"`
232+ }
233+
199234// Parameter describes a single operation parameter.
200235// A unique parameter is defined by a combination of a name and location.
201236type Parameter struct {
@@ -333,6 +368,9 @@ type Schema struct {
333368 Summary string `json:"summary,omitempty"`
334369 Description string `json:"description,omitempty"`
335370
371+ // Additional external documentation for this schema.
372+ ExternalDocs * ExternalDocumentation `json:"externalDocs,omitempty"`
373+
336374 // Value MUST be a string. Multiple types via an array are not supported.
337375 Type string `json:"type,omitempty"`
338376
@@ -526,6 +564,27 @@ type Schema struct {
526564 // Specifies that a schema is deprecated and SHOULD be transitioned out
527565 // of usage.
528566 Deprecated bool `json:"deprecated,omitempty"`
567+
568+ // If the instance value is a string, this property defines that the
569+ // string SHOULD be interpreted as binary data and decoded using the
570+ // encoding named by this property. RFC 2045, Section 6.1 lists
571+ // the possible values for this property.
572+ //
573+ // The value of this property MUST be a string.
574+ //
575+ // The value of this property SHOULD be ignored if the instance
576+ // described is not a string.
577+ ContentEncoding string `json:"contentEncoding,omitempty"`
578+
579+ // The value of this property must be a media type, as defined by RFC
580+ // 2046. This property defines the media type of instances
581+ // which this schema defines.
582+ //
583+ // The value of this property MUST be a string.
584+ //
585+ // The value of this property SHOULD be ignored if the instance
586+ // described is not a string.
587+ ContentMediaType string `json:"contentMediaType,omitempty"`
529588}
530589
531590// Property is item of Properties.
0 commit comments