Skip to content

Commit 987903c

Browse files
authored
Merge pull request #5093 from karenetheridge/ether/3.1-parameter-styles
v3.1: parameter style amendments
2 parents f72be1e + b044e33 commit 987903c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/oas.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ Path templating refers to the usage of template expressions, delimited by curly
4343
Each template expression in the path MUST correspond to a path parameter that is included in the [Path Item](#path-item-object) itself and/or in each of the Path Item's [Operations](#operation-object). An exception is if the path item is empty, for example due to ACL constraints, matching path parameters are not required.
4444

4545
The value for these path parameters MUST NOT contain any unescaped "generic syntax" characters described by [RFC3986](https://tools.ietf.org/html/rfc3986#section-3): forward slashes (`/`), question marks (`?`), or hashes (`#`).
46+
This means that when matching templates to request URLs, no values that include a forward slash are matched.
47+
For example, the template `/foo/{bar}` cannot match the URI path "/foo/alpha/beta" because the value of the template variable "bar" would have to be "alpha/beta".
4648
See [URL Percent-Encoding](#url-percent-encoding) for additional guidance on escaping characters.
4749

4850
### Media Types
@@ -1236,7 +1238,7 @@ The rules in this section apply to both the Parameter and [Header](#header-objec
12361238

12371239
When showing serialized examples using the `example` field or [Example Objects](#example-object), in most cases the value to show is just the value, with all relevant percent-encoding or other encoding/escaping applied, and also including any delimiters produced by the `style` and `explode` configuration.
12381240

1239-
In cases where the name is an inherent part of constructing the serialization, such as the `name=value` pairs produced by `style: "form"` or the combination of `style: "simple", explode: true`, the name and any delimiter between the name and value MUST be included.
1241+
In cases where the parameter name is an inherent part of constructing the serialization, such as the `name=value` pairs produced by the combination of `style: "form", explode: false`, the name and any delimiter between the name and value MUST be included.
12401242

12411243
The `matrix` and `label` styles produce a leading delimiter which is always a valid part of the serialization and MUST be included.
12421244
The RFC6570 operators corresponding to `style: "form"` produce a leading delimiter of either `?` or `&` depending on the exact syntax used.
@@ -1253,12 +1255,13 @@ The following section illustrates these rules.
12531255
Assume a parameter named `color` has one of the following values:
12541256

12551257
```js
1258+
undefined -> null
12561259
string -> "blue"
12571260
array -> ["blue", "black", "brown"]
12581261
object -> { "R": 100, "G": 200, "B": 150 }
12591262
```
12601263

1261-
The following table shows serialized examples, as would be shown with the `example` or `examples` keywords, of the different serializations for each value.
1264+
The following table shows serialized examples, as would be shown with the `example` or `examples` keywords, of the different serializations for the value of each supported type.
12621265

12631266
* The value _empty_ denotes the empty string, and is unrelated to the `allowEmptyValue` field.
12641267
* The behavior of combinations marked _n/a_ is undefined.
@@ -1268,10 +1271,10 @@ The following table shows serialized examples, as would be shown with the `examp
12681271

12691272
| [`style`](#style-values) | `explode` | `undefined` | `string` | `array` | `object` |
12701273
| ---- | ---- | ---- | ---- | ---- | ---- |
1271-
| matrix | false | ;color | ;color=blue | ;color=blue,black,brown | ;color=R,100,G,200,B,150 |
1272-
| matrix | true | ;color | ;color=blue | ;color=blue;color=black;color=brown | ;R=100;G=200;B=150 |
1273-
| label | false | . | .blue | .blue,black,brown | .R,100,G,200,B,150 |
1274-
| label | true | . | .blue | .blue.black.brown | .R=100.G=200.B=150 |
1274+
| matrix | false | _empty_ | ;color=blue | ;color=blue,black,brown | ;color=R,100,G,200,B,150 |
1275+
| matrix | true | _empty_ | ;color=blue | ;color=blue;color=black;color=brown | ;R=100;G=200;B=150 |
1276+
| label | false | _empty_ | .blue | .blue,black,brown | .R,100,G,200,B,150 |
1277+
| label | true | _empty_ | .blue | .blue.black.brown | .R=100.G=200.B=150 |
12751278
| simple | false | _empty_ | blue | blue,black,brown | R,100,G,200,B,150 |
12761279
| simple | true | _empty_ | blue | blue,black,brown | R=100,G=200,B=150 |
12771280
| form | false | <span style="white-space: nowrap;">color=</span> | <span style="white-space: nowrap;">color=blue</span> | <span style="white-space: nowrap;">color=blue,black,brown</span> | <span style="white-space: nowrap;">color=R,100,G,200,B,150</span> |
@@ -2541,7 +2544,7 @@ The unescaped, percent-decoded path template in the above examples would be `/2.
25412544
Runtime expressions allow defining values based on information that will only be available within the HTTP message in an actual API call.
25422545
This mechanism is used by [Link Objects](#link-object) and [Callback Objects](#callback-object).
25432546

2544-
The runtime expression is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax
2547+
The runtime expression is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax:
25452548

25462549
```abnf
25472550
expression = "$url" / "$method" / "$statusCode" / "$request." source / "$response." source

0 commit comments

Comments
 (0)