Skip to content

Commit fb5f5a4

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 f72be1e commit fb5f5a4

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/oas.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,7 @@ The following section illustrates these rules.
12531253
Assume a parameter named `color` has one of the following values:
12541254

12551255
```js
1256+
undefined -> null
12561257
string -> "blue"
12571258
array -> ["blue", "black", "brown"]
12581259
object -> { "R": 100, "G": 200, "B": 150 }
@@ -1268,10 +1269,10 @@ The following table shows serialized examples, as would be shown with the `examp
12681269

12691270
| [`style`](#style-values) | `explode` | `undefined` | `string` | `array` | `object` |
12701271
| ---- | ---- | ---- | ---- | ---- | ---- |
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 |
1272+
| matrix | false | _empty_ | ;color=blue | ;color=blue,black,brown | ;color=R,100,G,200,B,150 |
1273+
| matrix | true | _empty_ | ;color=blue | ;color=blue;color=black;color=brown | ;R=100;G=200;B=150 |
1274+
| label | false | _empty_ | .blue | .blue,black,brown | .R,100,G,200,B,150 |
1275+
| label | true | _empty_ | .blue | .blue.black.brown | .R=100.G=200.B=150 |
12751276
| simple | false | _empty_ | blue | blue,black,brown | R,100,G,200,B,150 |
12761277
| simple | true | _empty_ | blue | blue,black,brown | R=100,G=200,B=150 |
12771278
| 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)