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: versions/3.0.4.md
+25-25Lines changed: 25 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -3950,10 +3950,10 @@ Certain properties allow the use of Markdown which can contain HTML including sc
3950
3950
3951
3951
Serializing typed data to plain text, which can occur in `text/plain` message bodies or `multipart` parts, as well as in the `application/x-www-form-urlencoded` format in either URL query strings or message bodies, involves significant implementation- or application-defined behavior.
3952
3952
3953
-
Schema Objects validate data based on the [JSON Schema data model](https://tools.ietf.org/html/draft-wright-json-schema-00#section-4.2), which only recognizes four primitive data types: strings (which are [only broadly interoperable as UTF-8](https://datatracker.ietf.org/doc/html/rfc7159#section-8.1)), numbers, booleans, and `null`.
3954
-
Notably, integers are not a distinct type from other numbers, with `type: integer` being a convenience defined mathematically, rather than based on the presence or absence of a decimal point in any string representation.
3953
+
[Schema Objects](#schema-object) validate data based on the [JSON Schema data model](https://tools.ietf.org/html/draft-wright-json-schema-00#section-4.2), which only recognizes four primitive data types: strings (which are [only broadly interoperable as UTF-8](https://datatracker.ietf.org/doc/html/rfc7159#section-8.1)), numbers, booleans, and `null`.
3954
+
Notably, integers are not a distinct type from other numbers, with `type: "integer"` being a convenience defined mathematically, rather than based on the presence or absence of a decimal point in any string representation.
3955
3955
3956
-
The [Parameter Object](#parameter-object), [Header Object](#header-object) and [Encoding Object](#encoding-object) offer features to control how to arrange values from array or object types.
3956
+
The [Parameter Object](#parameter-object), [Header Object](#header-object), and [Encoding Object](#encoding-object) offer features to control how to arrange values from array or object types.
3957
3957
They can also be used to control how strings are further encoded to avoid reserved or illegal characters.
3958
3958
However, there is no general-purpose specification for converting schema-validated non-UTF-8 primitive data types (or entire arrays or objects) to strings.
3959
3959
@@ -3965,7 +3965,7 @@ Two cases do offer standards-based guidance:
3965
3965
Implementations of RFC6570 often have their own conventions for converting non-string values, but these are implementation-specific and not defined by the RFC itself.
3966
3966
This is one reason for the OpenAPI Specification to leave these conversions as implementation-defined: It allows using RFC6570 implementations regardless of how they choose to perform the conversions.
3967
3967
3968
-
To control the serialization of numbers, booleans, and `null` (or other values RFC6570 deems to be undefined) more precisely, schemas can be defined as `type: string` and constrained using `pattern`, `enum`, `format`, and other keywords to communicate how applications must pre-convert their data prior to schema validation.
3968
+
To control the serialization of numbers, booleans, and `null` (or other values RFC6570 deems to be undefined) more precisely, schemas can be defined as `type: "string"` and constrained using `pattern`, `enum`, `format`, and other keywords to communicate how applications must pre-convert their data prior to schema validation.
3969
3969
The resulting strings would not require any further type conversion.
3970
3970
3971
3971
The `format` keyword can assist in serialization.
@@ -3976,7 +3976,7 @@ Requiring input as pre-formatted, schema-validated strings also improves round-t
3976
3976
3977
3977
## Appendix C: Using RFC6570 Implementations
3978
3978
3979
-
Serialization is defined in terms of RFC6570 URI Templates in two scenarios:
3979
+
Serialization is defined in terms of [RFC6570](https://www.rfc-editor.org/rfc/rfc6570) URI Templates in two scenarios:
@@ -3985,27 +3985,27 @@ Serialization is defined in terms of RFC6570 URI Templates in two scenarios:
3985
3985
3986
3986
Implementations of this specification MAY use an implementation of RFC6570 to perform variable expansion, however, some caveats apply.
3987
3987
3988
-
Note that when using `style: form` RFC6570 expansion to produce an `application/x-www-form-urlencoded` HTTP message body, it is necessary to remove the `?` prefix that is produced to satisfy the URI query string syntax.
3988
+
Note that when using `style: "form"` RFC6570 expansion to produce an `application/x-www-form-urlencoded` HTTP message body, it is necessary to remove the `?` prefix that is produced to satisfy the URI query string syntax.
3989
3989
3990
3990
Note also that not all RFC6570 implementations support all four levels of operators, all of which are needed to fully support the OpenAPI Specification's usage.
3991
3991
Using an implementation with a lower level of support will require additional manual construction of URI Templates to work around the limitations.
3992
3992
3993
3993
### Equivalences Between Fields and RFC6570 Operators
3994
3994
3995
-
Certain field values translate to RFC6570 operators (or lack thereof):
3995
+
Certain field values translate to RFC6570 [operators](https://datatracker.ietf.org/doc/html/rfc6570#section-2.2) (or lack thereof):
Multiple `style: form` parameters are equivalent to a single RFC6570 [variable list](https://www.rfc-editor.org/rfc/rfc6570#section-2.2) using the `?` prefix operator:
4008
+
Multiple `style: "form"` parameters are equivalent to a single RFC6570 [variable list](https://www.rfc-editor.org/rfc/rfc6570#section-2.2) using the `?` prefix operator:
4009
4009
4010
4010
```YAML
4011
4011
parameters:
@@ -4027,7 +4027,7 @@ Note that RFC6570 does not specify behavior for compound values beyond the singl
4027
4027
4028
4028
### Non-RFC6570 Field Values and Combinations
4029
4029
4030
-
Configurations with no direct RFC6570 equivalent SHOULD also be handled according to RFC6570.
4030
+
Configurations with no direct [RFC6570](https://datatracker.ietf.org/doc/html/rfc6570) equivalent SHOULD also be handled according to RFC6570.
4031
4031
Implementations MAY create a properly delimited URI Template with variables for individual names and values using RFC6570 regular or reserved expansion (based on `allowReserved`).
4032
4032
4033
4033
This includes:
@@ -4036,7 +4036,7 @@ This includes:
4036
4036
* the combination of the style `form` with `allowReserved: true`, which is not allowed because only one prefix operator can be used at a time
4037
4037
* any parameter name that is not a legal RFC6570 variable name
4038
4038
4039
-
The Parameter Object's `name` field has a much more permissive syntax than [RFC6570 variable name syntax](https://www.rfc-editor.org/rfc/rfc6570#section-2.3).
4039
+
The Parameter Object's `name` field has a much more permissive syntax than RFC6570 [variable name syntax](https://www.rfc-editor.org/rfc/rfc6570#section-2.3).
4040
4040
A parameter name that includes characters outside of the allowed RFC6570 variable character set MUST be percent-encoded before it can be used in a URI Template.
4041
4041
4042
4042
### Examples
@@ -4056,7 +4056,7 @@ words:
4056
4056
4057
4057
#### RFC6570-Equivalent Expansion
4058
4058
4059
-
This array of Parameter Objects uses regular `style: "form"` expansion, fully supported by RFC6570:
4059
+
This array of Parameter Objects uses regular `style: "form"` expansion, fully supported by [RFC6570](https://datatracker.ietf.org/doc/html/rfc6570):
4060
4060
4061
4061
```YAML
4062
4062
parameters:
@@ -4090,7 +4090,7 @@ when expanded with the data given earlier, we get:
4090
4090
#### Expansion With Non-RFC6570-Supported Options
4091
4091
4092
4092
But now let's say that (for some reason), we really want that `/` in the `b` formula to show up as-is in the query string, and we want our words to be space-separated like in a written phrase.
4093
-
To do that, we'll add `allowReserved: true` to `formulas`, and change to `style: spaceDelimited` for `words`:
4093
+
To do that, we'll add `allowReserved: true` to `formulas`, and change to `style: "spaceDelimited"` for `words`:
4094
4094
4095
4095
```YAML
4096
4096
parameters:
@@ -4111,7 +4111,7 @@ parameters:
4111
4111
type: string
4112
4112
```
4113
4113
4114
-
We can't combine the `?` and `+` RFC6570 prefixes, and there's no way with RFC6570 to replace the `,` separator with a space character.
4114
+
We can't combine the `?` and `+` RFC6570 [prefixes](https://datatracker.ietf.org/doc/html/rfc6570#section-2.4.1), and there's no way with RFC6570 to replace the `,` separator with a space character.
4115
4115
So we need to restructure the data to fit a manually constructed URI Template that passes all of the pieces through the right sort of expansion.
4116
4116
4117
4117
Here is one such template, using a made-up convention of `words.0` for the first entry in the words value, `words.1` for the second, and `words.2` for the third:
@@ -4150,7 +4150,7 @@ The `/` and the pre-percent-encoded `%2B` have been left alone, but the disallow
4150
4150
4151
4151
#### Undefined Values and Manual URI Template Construction
4152
4152
4153
-
Care must be taken when manually constructing templates to handle the values that [RFC6570 considers to be _undefined_](https://datatracker.ietf.org/doc/html/rfc6570#section-2.3) correctly:
4153
+
Care must be taken when manually constructing templates to handle the values that RFC6570 [considers to be _undefined_](https://datatracker.ietf.org/doc/html/rfc6570#section-2.3) correctly:
4154
4154
4155
4155
```YAML
4156
4156
formulas: {}
@@ -4198,7 +4198,7 @@ parameters:
4198
4198
type: string
4199
4199
```
4200
4200
4201
-
We can't just pass `❤️: love!` to an RFC6570 implementation.
4201
+
We can't just pass `❤️: "love!"` to an RFC6570 implementation.
4202
4202
Instead, we have to pre-percent-encode the name (which is a six-octet UTF-8 sequence) in both the data and the URI Template:
0 commit comments