Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/oas.md
Original file line number Diff line number Diff line change
Expand Up @@ -5336,7 +5336,7 @@ components:
content:
application/json:
schema:
$ref: "#/components/api/schemas/Foo"
$ref: "#/components/schemas/Foo"
schemas:
Foo:
properties:
Expand Down Expand Up @@ -5457,7 +5457,7 @@ components:
```

In this example, all of the `$self` and `$id` values are relative URI references consisting of an absolute path.
This allows the retrieval URI to set the host (and scheme), in this case `https://staging.example.com`, resulting in the first document's `$self` being `https://staging.example.com/openapi`, and the second document's `$self` being `https://staging.example.com/api/shared/foo`, with `$id` values of `https://staging.example.com/api/schemas/foo` and `https://staging.example.com/api/schemas/bar`.
This allows the retrieval URI to set the host (and scheme), in this case `https://staging.example.com`, resulting in the first document's `$self` being `https://staging.example.com/api/openapi`, and the second document's `$self` being `https://staging.example.com/api/shared/foo`, with `$id` values of `https://staging.example.com/api/schemas/foo` and `https://staging.example.com/api/schemas/bar`.
Relative `$self` and `$id` values of this sort allow the same set of documents to work when deployed to other hosts, e.g. `https://example.com` (production) or `https://localhost:8080` (local development).

## Appendix G: Parsing and Resolution Guidance
Expand Down
Loading