Skip to content

Commit 018cc27

Browse files
committed
Added clarification on the use of relative references in URLs
1 parent f51b239 commit 018cc27

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

versions/3.0.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Additional utilities can also take advantage of the resulting files, such as tes
2626
- [Format](#format)
2727
- [File Structure](#file-structure)
2828
- [Data Types](#data-types)
29+
- [Relative References In Urls](#relativeReferences)
2930
- [Schema](#schema)
3031
- [OpenAPI Object](#openapi-object)
3132
- [Info Object](#info-object)
@@ -169,6 +170,14 @@ date | `string` | `date` | As defined by `full-date` - [RFC3339](http://xml2rfc.
169170
dateTime | `string` | `date-time` | As defined by `date-time` - [RFC3339](http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14)
170171
password | `string` | `password` | Used to hint UIs the input needs to be obscured.
171172

173+
### <a name="relativeReferences"></a>Relative References In URLs
174+
175+
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).
176+
Relative references are resolved using the URLs defined in the [Servers array](#servers) as a Base URI.
177+
178+
Relative references used in $ref are processed as per [JSON Schema](http://json-schema.org/latest/json-schema-core.html), i.e. using the URL of the current document as the base URI.
179+
180+
172181
### Schema
173182

174183
#### <a name="oasObject"></a>OpenAPI Object
@@ -317,7 +326,7 @@ An object representing a Server.
317326

318327
Field Name | Type | Description
319328
---|:---:|---
320-
<a name="serverUrlTemplate"></a>url | `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 [Host Template Parameter](#hostTemplateParameter) syntax. Template substitutions will be made when a variable is named in `{`brackets`}`.
329+
<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`}`.
321330
<a name="hostDescription"></a>description | `string` | An optional string describing the host designated by the URL.
322331
<a name="hostTemplates"></a>templates | [Templates Object](#hostTemplatesObject) | An object holding templates for substitution in the URL template
323332

0 commit comments

Comments
 (0)