Skip to content

Commit dc10386

Browse files
committed
Fixed server templates and all things relative
1 parent 260e45a commit dc10386

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

versions/3.0.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ Additional utilities can also take advantage of the resulting files, such as tes
3131
- [Schema](#schema)
3232
- [OpenAPI Object](#oasObject)
3333
- [Info Object](#infoObject)
34-
- [Contact Object](#contactObject)
35-
- [License Object](#licenseObject)
34+
- [Contact Object](#contactObject)
35+
- [License Object](#licenseObject)
3636
- [Server Object](#serverObject)
37+
- [Server Variables Object](#serverVariablesObject)
38+
- [Server Variable Object](#serverVariableObject)
3739
- [Components Object](#componentsObject)
3840
- [Paths Object](#pathsObject)
3941
- [Path Item Object](#pathItemObject)
@@ -159,12 +161,12 @@ date | `string` | `date` | As defined by `full-date` - [RFC3339](http://xml2rfc.
159161
dateTime | `string` | `date-time` | As defined by `date-time` - [RFC3339](http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14)
160162
password | `string` | `password` | Used to hint UIs the input needs to be obscured.
161163

162-
### <a name="relativeReferences"></a>Relative References In URLs
164+
### <a name="relativeReferences"></a>Relative References in URLs
163165

164166
Unless specified otherwise, all properties that are URLs MAY be relative references as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-4.2).
165-
Relative references are resolved using the URLs defined in the [Servers array](#servers) as a Base URI.
167+
Relative references are resolved using the URLs defined in the [`Server Object`](#serverObject) as a Base URI.
166168

167-
Relative references used in $ref are processed as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03), i.e. using the URL of the current document as the base URI.
169+
Relative references used in `$ref` are processed as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03), i.e. using the URL of the current document as the base URI. See also the [Reference Object](#referenceObject).
168170

169171
### Schema
170172

@@ -317,9 +319,9 @@ An object representing a Server.
317319

318320
Field Name | Type | Description
319321
---|:---:|---
320-
<a name="serverUrlTemplate"></a>url | `string` | A absolute 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 [Host Template Parameter](#hostTemplateParameter) syntax. Template substitutions will be made when a variable is named in `{`brackets`}`.
321-
<a name="hostDescription"></a>description | `string` | An optional string describing the host designated by the URL.
322-
<a name="hostTemplates"></a>templates | [Templates Object](#hostTemplatesObject) | An object holding templates for substitution in the URL template
322+
<a name="serverUrl"></a>url | `string` | A URL to the target host. This URL supports Server Variables and may be relative, to indicate that the host ___location is relative to the ___location where the OpenAPI definition is being served. Variable substitutions will be made when a variable is named in `{`brackets`}`.
323+
<a name="serverDescription"></a>description | `string` | An optional string describing the host designated by the URL.
324+
<a name="serverVariables"></a>variables | [Server Variables Object](#serverVariablesObject) | An object holding variables for substitution in the URL template.
323325

324326
This object can be extended with [Specification Extensions](#specificationExtensions).
325327

@@ -344,13 +346,13 @@ servers:
344346
description: Production server
345347
```
346348

347-
The following shows how templates can be used for a server configuration:
349+
The following shows how variables can be used for a server configuration:
348350

349351
```yaml
350352
servers:
351353
- url: https://{username}.gigantic-server.com:{port}/{basePath}
352354
description: The production API server
353-
templates:
355+
variables:
354356
username:
355357
# note! no enum here means it is an open value
356358
default: demo
@@ -365,26 +367,26 @@ servers:
365367
default: v2
366368
```
367369
368-
#### <a name="hostTemplatesObject"></a>Host Templates Object
370+
#### <a name="serverVariablesObject"></a>Server Variables Object
369371
370372
##### Patterned Fields
371373
372374
Field Pattern | Type | Description
373375
---|:---:|---
374-
<a name="variable"></a> [variable name] | [Host Template Parameter](#hostTemplateParameter) | A parameter to be used for substitution in the URL template.
376+
<a name="serverVariablesName"></a> {name} | [Server Variable Object](#serverVariableObject) | A variable to be used for substitution in a Server's URL template.
375377
376378
This object can be extended with [Specification Extensions](#specificationExtensions).
377379
378380
379-
#### <a name="hostTemplateParameter"></a>Host Template
381+
#### <a name="serverVariableObject"></a>Server Variable Object
380382
381-
An object representing a Host URL template
383+
An object representing a Server Variable for server URL template substituion.
382384
383385
Field Name | Type | Description
384386
---|:---:|---
385-
enum | [Possible Values] | An enumeration of primitive type values to be used if the substitution options are from a limited set.
386-
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.
387-
description | `string` | An optional description for the template parameter
387+
<a name="serverVariableEnum"></a>enum | [ `primitive` ] | An enumeration of primitive type values to be used if the substitution options are from a limited set.
388+
<a name="serverVariableDefault"></a>default | `primitive` | **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. Unlike the [Schema Object's](#schemaObject) `default`, this value MUST be provided by the consumer.
389+
<a name="serverVariableDescription"></a>description | `string` | An optional description for the server variable.
388390

389391
This object can be extended with [Specification Extensions](#specificationExtensions).
390392

@@ -580,8 +582,7 @@ components:
580582
#### <a name="pathsObject"></a>Paths Object
581583

582584
Holds the relative paths to the individual endpoints and their operations.
583-
The path is appended to the URL from the [`Server Object`](#serverObject) in order to construct
584-
the full URL. The Paths MAY be empty, due to [ACL constraints](#securityFiltering).
585+
The path is appended to the URL from the [`Server Object`](#serverObject) in order to construct the full URL. The Paths MAY be empty, due to [ACL constraints](#securityFiltering).
585586

586587
##### Patterned Fields
587588

0 commit comments

Comments
 (0)