Skip to content

Commit 0f5f3a0

Browse files
authored
Merge pull request OAI#812 from OAI/issue-589
Addressed metadata documentation cleanup from OAI#589
2 parents f85a8a9 + 7160c37 commit 0f5f3a0

File tree

1 file changed

+86
-14
lines changed

1 file changed

+86
-14
lines changed

versions/3.0.md

Lines changed: 86 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ It combines what previously was the Resource Listing and API Declaration (versio
125125

126126
Field Name | Type | Description
127127
---|:---:|---
128-
<a name="oasVersion"></a>openapi | `string` | **Required.** Specifies the OpenAPI Specification version being used. It can be used by tooling Specifications and clients to interpret the version. The structure shall be `major`.`minor`.`patch`, where `patch` versions _must_ be compatible with the existing `major`.`minor` tooling. Typically patch versions will be introduced to address errors in the documentation, and tooling should typically be compatible with the corresponding `major`.`minor` (3.0.*). Patch versions will correspond to patches of this document.
128+
<a name="oasVersion"></a>openapi | [OpenAPI Version String](#oasVersion) | **Required.** Specifies the OpenAPI Specification version being used. It can be used by tooling Specifications and clients to interpret the version. The structure shall be `major`.`minor`.`patch`, where `patch` versions _must_ be compatible with the existing `major`.`minor` tooling. Typically patch versions will be introduced to address errors in the documentation, and tooling should typically be compatible with the corresponding `major`.`minor` (3.0.*). Patch versions will correspond to patches of this document.
129129
<a name="oasInfo"></a>info | [Info Object](#infoObject) | **Required.** Provides metadata about the API. The metadata can be used by the clients if needed.
130-
<a name="oasHosts"></a>hosts | [Hosts Object](#hostsObject) | An array of Host objects which provide `scheme`, `host`, `port`, and `basePath` in an associative manner.
130+
<a name="oasHosts"></a>servers | [[Server Object](#serverObject)] | An optional array of Server Objects which provide connectivity information to a target server.
131131
<a name="oasPaths"></a>paths | [Paths Object](#pathsObject) | **Required.** The available paths and operations for the API.
132132
<a name="oasComponents"></a>components | [Components Object](#componentsObject) | An element to hold various schemas for the specification.
133133
<a name="oasSecurity"></a>security | [[Security Requirement Object](#securityRequirementObject)] | A declaration of which security schemes are applied for the API as a whole. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). Individual operations can override this definition.
@@ -136,6 +136,15 @@ Field Name | Type | Description
136136

137137
This object can be extended with [Specification Extensions](#specificationExtensions).
138138

139+
#### <a name="oasVersion"></a>OpenAPI Version String
140+
141+
The version string signifies the version of the OpenAPI Specification that the document complies to. The format for this string _must_ be `major`.`minor`.`patch`. The `patch` _may_ be suffixed by a hyphen and extra alphanumeric characters.
142+
143+
A `major`.`minor` shall be used to designate the OpenAPI Specification version, and will be considered compatible with the OpenAPI Specification specified by that `major`.`minor` version. The patch version will not be considered by tooling, making no distinction between `3.0.0` and `3.0.1`.
144+
145+
In subsequent versions of the OpenAPI Specification, care will be given such that increments of the `minor` version should not interfere with operations of tooling developed to a lower minor version. Thus a hypothetical `3.1.0` specification should be usable with tooling designed for `3.0.0`.
146+
147+
139148
#### <a name="infoObject"></a>Info Object
140149

141150
The object provides metadata about the API.
@@ -188,18 +197,6 @@ license:
188197
version: 1.0.1
189198
```
190199
191-
#### <a name="hostObject"></a>Host Object
192-
193-
An object representing a Host.
194-
195-
##### Fixed Fields
196-
197-
Field Name | Type | Description
198-
---|:---:|---
199-
<a name="oasHost"></a>host | `string` | The host (name or ip) serving the API. This MUST be the host only and does not include the scheme nor sub-paths. It MAY include a port. If the `host` is not included, the host serving the documentation is to be used (including the port). The `host` does not support [path templating](#pathTemplating).
200-
<a name="oasBasePath"></a>basePath | `string` | The base path on which the API is served, which is relative to the [`host`](#oasHost). If it is not included, the API is served directly under the `host`. The value MUST start with a leading slash (`/`). The `basePath` does not support [path templating](#pathTemplating).
201-
<a name="oasScheme"></a>scheme | `string` | The transfer protocol of the API. Values MUST be from the list: `"http"`, `"https"`, `"ws"`, `"wss"`. If the `scheme` is not included, the default scheme to be used is the one used to access the OpenAPI definition itself.
202-
203200
#### <a name="contactObject"></a>Contact Object
204201
205202
Contact information for the exposed API.
@@ -257,6 +254,78 @@ name: Apache 2.0
257254
url: http://www.apache.org/licenses/LICENSE-2.0.html
258255
```
259256

257+
#### <a name="serverObject"></a>Server Object
258+
259+
An object representing a Server.
260+
261+
##### Fixed Fields
262+
263+
Field Name | Type | Description
264+
---|:---:|---
265+
<a name="serverUrlTemplate"></a>server URL template | `string` | A URL to the target host. This URL supports template variables and may be relative, to indicate that the host location is relative to the location where the OpenAPI Specification is being served. Templates are _optional_ and specified by the [#hostTemplateParameter] syntax. Template substitutions will be made when a variable is named in `{`brackets`}`.
266+
<a name="hostDescription"></a>host description | `string` | An optional string describing the host designated by the URL.
267+
<a name="hostTemplates"></a>templates | [Templates Object](#hostTemplatesObject) | An object holding templates for substitution in the URL template
268+
269+
This object can be extended with [Specification Extensions](#specificationExtensions).
270+
271+
##### Server Object Example
272+
273+
The following shows how multiple hosts can be described in the Server Object array
274+
275+
```yaml
276+
servers:
277+
- url: https://development.gigantic-server.com/v1
278+
description: Development server
279+
- url: https://staging.gigantic-server.com/v1
280+
description: Staging server
281+
- url: https://api.gigantic-server.com/v1
282+
description: Production server
283+
```
284+
285+
The following shows how templates an be used for a server configuration
286+
287+
```yaml
288+
servers:
289+
- url: https://{username}.gigantic-server.com:{port}/{basePath}
290+
description: The production API server
291+
templates:
292+
username:
293+
# note! no enum here means it is an open value
294+
default: demo
295+
description: this value is assigned by the service provider, in this example `gigantic-server.com`
296+
port:
297+
enum:
298+
- 8443
299+
- 443
300+
default: 8443
301+
basePath:
302+
# open meaning there is the opportunity to use special base paths as assigned by the provider, default is `v2`
303+
default: v2
304+
```
305+
306+
#### <a name="hostTemplatesObject"></a>Host Templates Object
307+
308+
##### Patterned Fields
309+
310+
Field Pattern | Type | Description
311+
---|:---:|---
312+
<a name="variable"></a> [variable name] | [Host Template Parameter](#hostTemplateParameter) | A parameter to be used for substitution in the URL template.
313+
314+
This object can be extended with [Specification Extensions](#specificationExtensions).
315+
316+
317+
#### <a name="hostTemplateParameter"></a>Host Template
318+
319+
An object representing a Host URL template
320+
321+
Field Name | Type | Description
322+
---|:---:|---
323+
enum | [Possible Values] | An enumeration of primitive type values to be used if the substitution options are from a limited set.
324+
default | [Default Value] | **Required.** The default value to use for substitution if an alternate value is not specified, and will be sent if an alternative value is _not_ supplied.
325+
description | `string` | An optional description for the template parameter
326+
327+
This object can be extended with [Specification Extensions](#specificationExtensions).
328+
260329
#### <a name="componentsObject"></a>Components Object
261330

262331
Holds a set of schemas for different aspects of the OAS.
@@ -1950,6 +2019,9 @@ The following properties are taken from the JSON Schema definition but their def
19502019
Their definition is the same as the one from JSON Schema, only where the original definition references the JSON Schema definition, the [Schema Object](#schemaObject) definition is used instead.
19512020
- items
19522021
- allOf
2022+
- oneOf
2023+
- anyOf
2024+
- not
19532025
- properties
19542026
- additionalProperties
19552027

0 commit comments

Comments
 (0)