Skip to content

Commit df5203f

Browse files
committed
Review feedback from @notEthan
1 parent 17db5c9 commit df5203f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/oas.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ Unless specified otherwise, all fields that are URIs MAY be relative references
312312

313313
Relative URI references are resolved using the appropriate base URI, which MUST be determined in accordance with [[RFC3986]] [Section 5.1.1 – 5.1.4](https://tools.ietf.org/html/rfc3986#section-5.1.1).
314314
RFC3986 Section 5.1.1 requires determining the base URI from within a resource's contents, which for the OAS means the `$self` field of the [OpenAPI Object](#openapi-object) for an [OpenAPI Document](#openapi-document), or the `$id` JSON Schema keyword in [Schema Objects](#schema-object).
315-
Within an OpenAPI Document, a Schema Object that does not have its base URI set by `$id` uses `$self` the same as any other Object, treating the OpenAPI Document as the "encapsulating entity" in accordance with RFC3986 Section 5.1.2.
315+
Within an OpenAPI Document, a Schema Object that does not have its base URI set by `$id` takes its base URI from the OpenAPI Object's `$self` field the same as any other Object, treating the OpenAPI Document as the "encapsulating entity" in accordance with RFC3986 Section 5.1.2.
316316
See [JSON Schema draft 2020-12 Section 8.2](https://www.ietf.org/archive/id/draft-bhutton-json-schema-01.html#section-8.2) for more information about base URIs in Schema Objects.
317317

318318
The most common base URI source in the absence of `$self` or `$id` is the retrieval URI, in accordance with RFC3986 Section 5.1.3.
@@ -337,6 +337,7 @@ Given a retrieval URI of `https://example.com/foo/bar/openapi.yaml`, and the fol
337337
openapi: 3.2.0
338338
$self: /openapi
339339
info:
340+
title: Example API
340341
version: 1.0
341342
components:
342343
pathItems:
@@ -355,6 +356,7 @@ In the next example, the retrieval URI is irrelevant, because `$self` is already
355356
openapi: 3.2.0
356357
$self: https://example.com/openapi
357358
info:
359+
title: Example API
358360
version: 1.0
359361
components:
360362
schemas:
@@ -394,6 +396,7 @@ Assume a retrieval URL of `https://device1.example.com` for the following OpenAP
394396
openapi: 3.2.0
395397
$self: https://apidescriptions.example.com/foo
396398
info:
399+
title: Example API
397400
version: 1.0
398401
servers:
399402
- url: .

0 commit comments

Comments
 (0)