Skip to content

Commit 2233066

Browse files
committed
added hosts setting
1 parent a75318f commit 2233066

File tree

1 file changed

+68
-4
lines changed

1 file changed

+68
-4
lines changed

versions/3.0.md

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Field Name | Type | Description
127127
---|:---:|---
128128
<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>hosts | [Host Object](#hostObject) | An array of Host objects which provide connectivity information to a target host.
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.
@@ -205,9 +205,73 @@ An object representing a Host.
205205
206206
Field Name | Type | Description
207207
---|:---:|---
208-
<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).
209-
<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).
210-
<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.
208+
<a name="hostUrlTemplate"></a>host 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`}`.
209+
<a name="hostDescription"></a>host description | `string` | An optional string describing the host designated by the URL.
210+
<a name="hostTemplates"></a>templates | [Templates Object](#hostTemplatesObject) | An object holding templates for substitution in the URL template
211+
212+
This object can be extended with [Specification Extensions](#specificationExtensions).
213+
214+
##### Host Object Example
215+
216+
The following shows how multiple hosts can be described in the host object array
217+
218+
```yaml
219+
servers:
220+
- url: https://development.gigantic-server.com/v1
221+
description: Development server
222+
- url: https://staging.gigantic-server.com/v1
223+
description: Staging server
224+
- url: https://api.gigantic-server.com/v1
225+
description: Production server
226+
```
227+
228+
The following shows how templates an be used for a host configuration
229+
230+
```yaml
231+
servers:
232+
- url: {scheme}://{host}:{port}/{basePath}
233+
description: The production API server
234+
templates:
235+
scheme:
236+
enum:
237+
- https
238+
- http
239+
default: https
240+
host:
241+
enum:
242+
- na1.gigantic-server.com
243+
- na2.gigantic-server.com
244+
port:
245+
enum:
246+
- 8443
247+
- 443
248+
default: 8443
249+
basePath:
250+
default: v2
251+
```
252+
253+
#### <a name="hostTemplatesObject"></a>Host Templates Object
254+
255+
##### Patterned Fields
256+
257+
Field Pattern | Type | Description
258+
---|:---:|---
259+
<a name="variable"></a> [variable name] | [Host Template Parameter](#hostTemplateParameter) | A parameter to be used for substitution in the URL template.
260+
261+
This object can be extended with [Specification Extensions](#specificationExtensions).
262+
263+
264+
#### <a name="hostTemplateParameter"></a>Host Template
265+
266+
An object representing a Host URL template
267+
268+
Field Name | Type | Description
269+
---|:---:|---
270+
enum | [Possible Values] | An enumeration of primitive type values to be used if the substitution options are from a limited set.
271+
default | [Default Value] | **Required.** The default value to use for substitution if an alternate value is not specified
272+
273+
This object can be extended with [Specification Extensions](#specificationExtensions).
274+
211275

212276
#### <a name="contactObject"></a>Contact Object
213277

0 commit comments

Comments
 (0)