Skip to content

Commit 9307120

Browse files
fixes to examples of template expansion of undefined (null) values
RFC6570 section 3.2.1 says: "A variable that is undefined (Section 2.3) has no value and is ignored by the expansion process. If all of the variables in an expression are undefined, then the expression's expansion is the empty string." ..therefore the provided examples for the "matrix" and "label" styles are incorrect -- the full expansion is the empty string, with no leader/prefix.
1 parent 86dbf8e commit 9307120

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/oas.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,7 @@ See the [Header Object](#header-object) for special rules for showing examples o
898898
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:
899899

900900
```js
901+
undefined -> null
901902
string -> "blue"
902903
array -> ["blue", "black", "brown"]
903904
object -> { "R": 100, "G": 200, "B": 150 }
@@ -913,10 +914,10 @@ The following table shows serialized examples, as would be shown with the `seria
913914

914915
| [`style`](#style-values) | `explode` | `undefined` | `string` | `array` | `object` |
915916
| ---- | ---- | ---- | ---- | ---- | ---- |
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 |
917+
| matrix | false | _empty_ | ;color=blue | ;color=blue,black,brown | ;color=R,100,G,200,B,150 |
918+
| matrix | true | _empty_ | ;color=blue | ;color=blue;color=black;color=brown | ;R=100;G=200;B=150 |
919+
| label | false | _empty_ | .blue | .blue,black,brown | .R,100,G,200,B,150 |
920+
| label | true | _empty_ | .blue | .blue.black.brown | .R=100.G=200.B=150 |
920921
| simple | false | _empty_ | blue | blue,black,brown | R,100,G,200,B,150 |
921922
| simple | true | _empty_ | blue | blue,black,brown | R=100,G=200,B=150 |
922923
| 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> |

0 commit comments

Comments
 (0)