You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/oas.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,7 @@ In addition to the required fields, at least one of the `components`, `paths`, o
95
95
| Field Name | Type | Description |
96
96
| ---- | :----: | ---- |
97
97
| <aname="oas-version"></a>openapi |`string`|**REQUIRED**. This string MUST be the [version number](#versions-and-deprecation) of the OpenAPI Specification that the OpenAPI document uses. The `openapi` field SHOULD be used by tooling to interpret the OpenAPI document. This is _not_ related to the [`info.version`](#info-version) string, which describes the OpenAPI document's version. |
98
-
| <aname="oas-self"></a>$self |`string`| This string MUST be in the form of a URI-reference as defined by [[RFC3986]][Section 4.1](https://www.rfc-editor.org/rfc/rfc3986#section-4.1). The `$self` field provides the self-assigned URI of this document, which also serves as its base URI in accordance with [[RFC3986]][Section 5.1.1](https://www.rfc-editor.org/rfc/rfc3986#section-5.1.1). Implementations MUST support identifying the targets of [API description URIs](#relative-references-in-api-description-uris) using the URI defined by this field when it is present. See [Establishing the Base URI](#establishing-the-base-uri) for the base URI behavior when `$self` is absent or relative, and see [Appendix F]((#appendix-f-examples-of-base-uri-determination-and-reference-resolution)) for examples of using `$self` to resolve references. |
98
+
| <aname="oas-self"></a>$self |`string`| This string MUST be in the form of a URIreference as defined by [[RFC3986]][Section 4.1](https://www.rfc-editor.org/rfc/rfc3986#section-4.1). The `$self` field provides the self-assigned URI of this document, which also serves as its base URI in accordance with [[RFC3986]][Section 5.1.1](https://www.rfc-editor.org/rfc/rfc3986#section-5.1.1). Implementations MUST support identifying the targets of [API description URIs](#relative-references-in-api-description-uris) using the URI defined by this field when it is present. See [Establishing the Base URI](#establishing-the-base-uri) for the base URI behavior when `$self` is absent or relative, and see [Appendix F]((#appendix-f-examples-of-base-uri-determination-and-reference-resolution)) for examples of using `$self` to resolve references. |
99
99
| <aname="oas-info"></a>info |[Info Object](#info-object)|**REQUIRED**. Provides metadata about the API. The metadata MAY be used by tooling as required. |
100
100
| <aname="oas-json-schema-dialect"></a> jsonSchemaDialect |`string`| The default value for the `$schema` keyword within [Schema Objects](#schema-object) contained within this OAS document. This MUST be in the form of a URI. |
101
101
| <aname="oas-servers"></a>servers |[[Server Object](#server-object)]| An array of Server Objects, which provide connectivity information to a target server. If the `servers` field is not provided, or is an empty array, the default value would be an array consisting of a single [Server Object](#server-object) with a [url](#server-url) value of `/`. |
@@ -151,7 +151,7 @@ Unless specified otherwise, all fields that are URIs MAY be relative references
151
151
152
152
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) and, for Schema objects, [JSON Schema draft 2020-12 Section 8.2](https://www.ietf.org/archive/id/draft-bhutton-json-schema-01.html#section-8.2), as illustrated by the examples in [Appendix F: Examples of Base URI Determination and Reference Resolution](#appendix-f-examples-of-base-uri-determination-and-reference-resolution).
153
153
154
-
If `$self` is a relative URI-reference, it is resolved against the next possible base URI source ([[RFC3986]][Section 5.1.2 – 5.1.4](https://tools.ietf.org/html/rfc3986#section-5.1.2)) before being used for the resolution of other relative URI-references.
154
+
If `$self` is a relative URIreference, it is resolved against the next possible base URI source ([[RFC3986]][Section 5.1.2 – 5.1.4](https://tools.ietf.org/html/rfc3986#section-5.1.2)) before being used for the resolution of other relative URIreferences.
155
155
156
156
The most common base URI source that is used in the event of a missing or relative `$self` (in the [OpenAPI Object](#openapi-object)) and (for [Schema Object](#schema-object)) `$id` is the retrieval URI.
157
157
Implementations MAY support document retrieval, although see the [Security Considerations](#security-considerations) sections for additional guidance.
@@ -2578,10 +2578,10 @@ solely by the existence of a relationship.
2578
2578
2579
2579
##### `operationRef` Examples
2580
2580
2581
-
As the `operationId` is an optional field in an [Operation Object](#operation-object), references MAY instead be made through a URI-reference with `operationRef`.
2581
+
As the `operationId` is an optional field in an [Operation Object](#operation-object), references MAY instead be made through a URIreference with `operationRef`.
2582
2582
Note that both of these examples reference operations that can be identified via the [Paths Object](#paths-object) to ensure that the operation's path template is unambiguous.
2583
2583
2584
-
A relative URI-reference `operationRef`:
2584
+
A relative URIreference `operationRef`:
2585
2585
2586
2586
```yaml
2587
2587
links:
@@ -5383,7 +5383,7 @@ While this sort of internal resolution can be performed in practice without choo
5383
5383
5384
5384
### Resolving Relative `$self` and `$id`
5385
5385
5386
-
Let's re-consider the first example in this appendix, but with relative URI-references for `$self` and `$id`, and retrieval URIs that support that relative usage:
5386
+
Let's re-consider the first example in this appendix, but with relative URIreferences for `$self` and `$id`, and retrieval URIs that support that relative usage:
5387
5387
5388
5388
5389
5389
Assume that the following is retrieved from `https://staging.example.com/api/openapi`:
@@ -5427,7 +5427,7 @@ components:
5427
5427
type: string
5428
5428
```
5429
5429
5430
-
In this example, all of the `$self` and `$id` values are relative URI-references consisting of an absolute path.
5430
+
In this example, all of the `$self` and `$id` values are relative URIreferences consisting of an absolute path.
5431
5431
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`.
5432
5432
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).
0 commit comments