Skip to content

Commit 7141ddf

Browse files
authored
Merge pull request OAI#881 from OAI/dm/relative-url
Added clarification on the use of relative references in URLs
2 parents 17a389a + 0b0c283 commit 7141ddf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

versions/3.0.md

Lines changed: 9 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)
@@ -167,6 +168,13 @@ date | `string` | `date` | As defined by `full-date` - [RFC3339](http://xml2rfc.
167168
dateTime | `string` | `date-time` | As defined by `date-time` - [RFC3339](http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14)
168169
password | `string` | `password` | Used to hint UIs the input needs to be obscured.
169170

171+
### <a name="relativeReferences"></a>Relative References In URLs
172+
173+
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).
174+
Relative references are resolved using the URLs defined in the [Servers array](#servers) as a Base URI.
175+
176+
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.
177+
170178
### Schema
171179

172180
#### <a name="oasObject"></a>OpenAPI Object
@@ -315,7 +323,7 @@ An object representing a Server.
315323

316324
Field Name | Type | Description
317325
---|:---:|---
318-
<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`}`.
326+
<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`}`.
319327
<a name="hostDescription"></a>description | `string` | An optional string describing the host designated by the URL.
320328
<a name="hostTemplates"></a>templates | [Templates Object](#hostTemplatesObject) | An object holding templates for substitution in the URL template
321329

0 commit comments

Comments
 (0)