Skip to content

Commit 942cf8c

Browse files
committed
base uri: reference RFC3986
1 parent 1e94ea4 commit 942cf8c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/oas.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5222,7 +5222,7 @@ This section shows each of the four possible sources of base URIs, followed by a
52225222

52235223
### Base URI Within Content
52245224

5225-
A base URI within the resource's content (RFC3986 Section 5.1.1) is the highest-precedence source of a base URI.
5225+
A base URI within the resource's content ([RFC3986](https://tools.ietf.org/html/rfc3986#section-5.1.1)) is the highest-precedence source of a base URI.
52265226
For OpenAPI documents, this source is the OpenAPI Object's `$self` field, while for Schema Objects that contain a `$id`, or are a subschema of a Schema Object containing a `$id`, the source is the `$id` field:
52275227

52285228
Assume the retrieval URI of the following document is `file://home/someone/src/api/openapi.yaml`:
@@ -5282,7 +5282,7 @@ Note also that it is impossible for the reference at `#/components/schemas/Foo/p
52825282

52835283
### Base URI From Encapsulating Entity
52845284

5285-
If no base URI can be determined within the content, the next location to search is any encapsulating entity (RFC3986 Section 5.1.2).
5285+
If no base URI can be determined within the content, the next location to search is any encapsulating entity ([RFC3986](https://tools.ietf.org/html/rfc3986#section-5.1.2)).
52865286

52875287
This is common for Schema Objects encapsulated within an OpenAPI document.
52885288
An example of an OpenAPI Object itself being encapsulated in another entity would be a `multipart/related` archive ([[?RFC2557]]), such as the following `multipart/related; boundary="boundary-example"; type="application/openapi+yaml"` document.
@@ -5343,7 +5343,7 @@ Similarly, the `url` field of the [External Documentation Object](#external-docu
53435343

53445344
### Base URI From the Retrieval URI
53455345

5346-
If no base URI is provided from either of the previous sources, the next source is the retrieval URI (RFC 3986 Section 5.1.3).
5346+
If no base URI is provided from either of the previous sources, the next source is the retrieval URI ([RFC3986](https://tools.ietf.org/html/rfc3986#section-5.1.3)).
53475347

53485348
Assume this document was retrieved from `https://example.com/api/openapis.yaml`:
53495349

@@ -5378,7 +5378,7 @@ Resolving the `$ref: schemas/foo` against the retrieval URI of the OpenAPI docum
53785378

53795379
### Application-Specific Default Base URI
53805380

5381-
When constructing an OpenAPI document in memory that does not have a `$self`, or an encapsulating entity, or a retrieval URI, applications can resolve internal (fragment-only) references by assuming a default base URI (RFC3986 Section 5.1.4).
5381+
When constructing an OpenAPI document in memory that does not have a `$self`, or an encapsulating entity, or a retrieval URI, applications can resolve internal (fragment-only) references by assuming a default base URI ([RFC3986](https://tools.ietf.org/html/rfc3986#section-5.1.4)).
53825382
While this sort of internal resolution can be performed in practice without choosing a base URI, choosing one, such as a URN with a randomly generated UUID (e.g. `urn:uuid:f26cdaad-3193-4398-a838-4ecb7326c4c5`) avoids the need to implement it as a special case.
53835383

53845384
### Resolving Relative `$self` and `$id`

0 commit comments

Comments
 (0)