Skip to content

Commit c287945

Browse files
authored
Merge pull request #5092 from karenetheridge/ether/3.2-parameter-styles
v3.2: parameter style amendments
2 parents 984ae23 + e21a0f9 commit c287945

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/oas.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ servers:
353353
354354
An object representing a Server Variable for server URL template substitution.
355355
356-
The server URL templating is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax.
356+
The server URL templating is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax:
357357
358358
```abnf
359359
server-url-template = 1*( literals / server-variable )
@@ -519,9 +519,12 @@ Path templating refers to the usage of template expressions, delimited by curly
519519
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.
520520

521521
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 (`#`).
522+
This means that when matching templates to request URLs, no values that include a forward slash are matched.
523+
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".
524+
522525
See [URL Percent-Encoding](#url-percent-encoding) for additional guidance on escaping characters.
523526

524-
The path templating is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax
527+
The path templating is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax:
525528

526529
```abnf
527530
path-template = "/" *( path-segment "/" ) [ path-segment ]
@@ -882,7 +885,7 @@ The rules in this section apply to both the Parameter and [Header](#header-objec
882885

883886
When showing serialized examples, such as with the [Example Object's](#example-object) `serializedValue` or `externalValue` fields, 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.
884887

885-
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.
888+
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.
886889

887890
The `matrix` and `label` styles produce a leading delimiter which is always a valid part of the serialization and MUST be included.
888891
The RFC6570 operators corresponding to `style: "form"` produce a leading delimiter of either `?` or `&` depending on the exact syntax used.
@@ -898,12 +901,13 @@ See the [Header Object](#header-object) for special rules for showing examples o
898901
Assume a parameter named `color` has one of the following values, where the value to the right of the `->` is what would be shown in the `dataValue` field of an Example Object:
899902

900903
```js
904+
undefined -> null
901905
string -> "blue"
902906
array -> ["blue", "black", "brown"]
903907
object -> { "R": 100, "G": 200, "B": 150 }
904908
```
905909

906-
The following table shows serialized examples, as would be shown with the `serializedValue` field of an Example Object, of the different serializations for each value.
910+
The following table shows serialized examples, as would be shown with the `serializedValue` field of an Example Object, of the different serializations for the value of each supported type.
907911

908912
* The value _empty_ denotes the empty string, and is unrelated to the `allowEmptyValue` field.
909913
* The behavior of combinations marked _n/a_ is undefined.
@@ -913,10 +917,10 @@ The following table shows serialized examples, as would be shown with the `seria
913917

914918
| [`style`](#style-values) | `explode` | `undefined` | `string` | `array` | `object` |
915919
| ---- | ---- | ---- | ---- | ---- | ---- |
916-
| matrix | false | ;color | ;color=blue | ;color=blue,black,brown | ;color=R,100,G,200,B,150 |
917-
| matrix | true | ;color | ;color=blue | ;color=blue;color=black;color=brown | ;R=100;G=200;B=150 |
918-
| label | false | . | .blue | .blue,black,brown | .R,100,G,200,B,150 |
919-
| label | true | . | .blue | .blue.black.brown | .R=100.G=200.B=150 |
920+
| matrix | false | _empty_ | ;color=blue | ;color=blue,black,brown | ;color=R,100,G,200,B,150 |
921+
| matrix | true | _empty_ | ;color=blue | ;color=blue;color=black;color=brown | ;R=100;G=200;B=150 |
922+
| label | false | _empty_ | .blue | .blue,black,brown | .R,100,G,200,B,150 |
923+
| label | true | _empty_ | .blue | .blue.black.brown | .R=100.G=200.B=150 |
920924
| simple | false | _empty_ | blue | blue,black,brown | R,100,G,200,B,150 |
921925
| simple | true | _empty_ | blue | blue,black,brown | R=100,G=200,B=150 |
922926
| 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> |
@@ -2611,7 +2615,7 @@ The unescaped, percent-decoded path template in the above examples would be `/2.
26112615
Runtime expressions allow defining values based on information that will only be available within the HTTP message in an actual API call.
26122616
This mechanism is used by [Link Objects](#link-object) and [Callback Objects](#callback-object).
26132617

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

26162620
```abnf
26172621
expression = "$url" / "$method" / "$statusCode" / "$request." source / "$response." source

0 commit comments

Comments
 (0)