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
+29-26Lines changed: 29 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -769,14 +769,14 @@ See [Appendix E](#appendix-e-percent-encoding-and-form-media-types) for a detail
769
769
There are five possible parameter locations specified by the `in` field:
770
770
771
771
* path - Used together with [Path Templating](#path-templating), where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, the path parameter is `itemId`.
772
-
* query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`; MUST NOT appear in the same operation (or in the operation's path-item) as an `in: "querystring"` parameter.
772
+
* query - Parameters that are appended to the URL with the `?` character (or for subsequent query parameters, with the `&` character); MUST NOT appear in the same operation (or in the operation's path-item) as an `in: "querystring"` parameter.
773
773
* querystring - A parameter that treats the entire URL query string as a value which MUST be specified using the `content` field, most often with media type `application/x-www-form-urlencoded` using [Encoding Objects](#encoding-object) in the same way as with request bodies of that media type; MUST NOT appear more than once, and MUST NOT appear in the same operation (or in the operation's path-item) as any `in: "query"` parameters.
774
774
* header - Custom headers that are expected as part of the request. Note that [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#section-5.1) states header names are case-insensitive.
775
775
* cookie - Used to pass a specific cookie value to the API.
776
776
777
777
#### Fixed Fields
778
778
779
-
The rules for serialization of the parameter are specified in one of two ways.
779
+
The rules for serialization and deserialization of the parameter are specified in one of two ways.
780
780
Parameter Objects MUST include either a `content` field or a `schema` field, but not both.
781
781
See [Appendix B](#appendix-b-data-type-conversion) for a discussion of converting values of various types to string representations.
782
782
@@ -819,8 +819,8 @@ In these cases, implementations MUST pass values through unchanged rather than a
819
819
| ---- | :----: | ---- |
820
820
| <a name="parameter-style"></a>style | `string` | Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of `in`): for `"query"` - `"form"`; for `"path"` - `"simple"`; for `"header"` - `"simple"`; for `"cookie"` - `"form"` (for compatibility reasons; note that `style: "cookie"` SHOULD be used with `in: "cookie"`; see [Appendix D](#appendix-d-serializing-headers-and-cookies) for details). |
821
821
| <a name="parameter-explode"></a>explode | `boolean` | When this is true, parameter values of type `array` or `object` generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters, or when [`style`](#parameter-style) is `"deepObject"`, this field has no effect. When `style` is `"form"` or `"cookie"`, the default value is `true`. For all other styles, the default value is `false`. |
822
-
| <a name="parameter-allow-reserved"></a>allowReserved | `boolean` | When this is true, parameter values are serialized using reserved expansion, as defined by [RFC6570](https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.3), which allows [RFC3986's reserved character set](https://datatracker.ietf.org/doc/html/rfc3986#section-2.2), as well as percent-encoded triples, to pass through unchanged, while still percent-encoding all other disallowed characters (including `%` outside of percent-encoded triples). Applications are still responsible for percent-encoding reserved characters that are not allowed by the rules of the `in` destination or media type, or are [not allowed in the path by this specification](#path-templating); see [URL Percent-Encoding](#url-percent-encoding) for details. The default value is `false`. This field only applies to `in` and `style` values that automatically percent-encode. |
823
-
| <a name="parameter-schema"></a>schema | [Schema Object](#schema-object) | The schema defining the type used for the parameter. |
822
+
| <a name="parameter-allow-reserved"></a>allowReserved | `boolean` | When this is true, parameter values are serialized using reserved expansion, as defined by [RFC6570](https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.3), which allows [RFC3986's reserved character set](https://datatracker.ietf.org/doc/html/rfc3986#section-2.2), as well as percent-encoded triples, to pass through unchanged, while still percent-encoding all other disallowed characters (including `%` outside of percent-encoded triples). Applications are still responsible for percent-encoding reserved characters that are not allowed by the rules of the `in` destination or media type, or are [not allowed in the path by this specification](#path-templating); see [URL Percent-Encoding](#url-percent-encoding) for details. The default value is `false`. This field only applies to `in` and `style` values that automatically percent-encode (that is: `in: path`, `in: query`, and `in: cookie` with `style: form`). |
823
+
| <a name="parameter-schema"></a>schema | [Schema Object](#schema-object) | The schema defining the type and other constraints used for the parameter. |
824
824
825
825
See also [Appendix C: Using RFC6570-Based Serialization](#appendix-c-using-rfc6570-based-serialization) for additional guidance.
826
826
@@ -923,19 +923,19 @@ The following table shows serialized examples, as would be shown with the `seria
Many frameworks define query string syntax for complex values, such as appending array indices to parameter names or indicating multiple levels of of nested objects, which go well beyond the capabilities of the `deepObject` style.
938
+
Many frameworks define query string syntax for complex values, such as appending array indices to parameter names or indicating multiple levels of nested objects, which go well beyond the capabilities of the `deepObject` style.
939
939
940
940
As these are not standards, and often contradict each other, the OAS does not attempt to support them directly.
941
941
Two avenues are available for supporting such formats with `in: "querystring"`:
@@ -1070,7 +1070,7 @@ examples:
1070
1070
dataValue:
1071
1071
page: 4
1072
1072
pageSize: 50
1073
-
serializeValue: page=4&pageSize=50
1073
+
serializedValue: page=4&pageSize=50
1074
1074
```
1075
1075
1076
1076
A complex parameter using `content` to define serialization, with multiple levels and types of examples shown to make the example usage options clear — note that `dataValue` is the same at both levels and does not need to be shown in both places in normal usage, but `serializedValue` is different:
A querystring parameter using regular form encoding, but managed with a Media Type Object.
@@ -1108,6 +1110,7 @@ Examples are shown at both the media type and parameter level to emphasize that,
1108
1110
1109
1111
```yaml
1110
1112
in: querystring
1113
+
name: metadata
1111
1114
content:
1112
1115
application/x-www-form-urlencoded:
1113
1116
schema:
@@ -2383,7 +2386,7 @@ The `serializedValue` and `externalValue` fields both MUST show the serialized f
2383
2386
For Media Type Objects, this is a document of the appropriate media type, with any Encoding Object effects applied.
2384
2387
For Parameter and Header Objects using `schema` and `style` rather than a Media Type Object, see [Style Examples](#style-examples) for what constitutes a serialized value.
2385
2388
2386
-
##### Criteria for `serializedExample`
2389
+
##### Criteria for `serializedValue`
2387
2390
2388
2391
A serialization can be represented as a valid Unicode string in `serializedValue` if any of the following are true of the serialization:
2389
2392
@@ -2858,7 +2861,7 @@ components:
2858
2861
In an HTTP message, the serialized example would look like:
2859
2862
2860
2863
```http
2861
-
Set-Cookie: lang=en-US; Expires=Wed, 09 Jun 2021 10:18:14 GM
2864
+
Set-Cookie: lang=en-US; Expires=Wed, 09 Jun 2021 10:18:14 GMT
2862
2865
Set-Cookie: foo=bar; Expires=Wed, 09 Jun 2021 10:18:14 GMT
2863
2866
Set-Cookie: urlSafeData=Hello%2C%20world%21
2864
2867
```
@@ -4449,8 +4452,7 @@ application/xml:
4449
4452
- Some text
4450
4453
- unit: cubits
4451
4454
value: 42
4452
-
null
4453
-
]
4455
+
- null
4454
4456
externalValue: ./examples/OneTwoThree.xml
4455
4457
```
4456
4458
@@ -4909,7 +4911,7 @@ parameters:
4909
4911
type: string
4910
4912
```
4911
4913
4912
-
This example is equivalent to RFC6570's `{?foo*,bar}`, and **NOT** `{?foo*}{&bar}`. The latter is problematic because if `foo` is not defined, the result will be an invalid URI.
4914
+
This example is equivalent to RFC6570's `{?foo*,bar}`, and **NOT** `{?foo*}{&bar}`. The latter is problematic because if `foo` is not defined (see [RFC6570 §2.3](https://www.rfc-editor.org/rfc/rfc6570#section-2.3) for details on what is considered undefined), the result will be an invalid URI.
4913
4915
The `&` prefix operator has no equivalent in the Parameter Object.
4914
4916
4915
4917
Note that RFC6570 does not specify behavior for compound values beyond the single level addressed by `explode`. The result of using objects or arrays where no behavior is clearly specified for them is implementation-defined.
0 commit comments