@@ -33,96 +33,102 @@ Here are some examples to illustrate the changes.
33
33
34
34
### Open tuple
35
35
<table >
36
- <tr >
37
- <th>Draft 2019-09</th>
38
- <th>Draft 2020-12</th>
39
- </tr >
40
- <tr >
41
- <td>
42
- ```json
43
- {
44
- "items": [
45
- { "$ref": "#/$defs/foo" },
46
- { "$ref": "#/$defs/bar" }
47
- ]
48
- }
49
- ```
50
- </td>
51
- <td>
52
- ```json
53
- {
54
- "prefixItems": [
55
- { "$ref": "#/$defs/foo" },
56
- { "$ref": "#/$defs/bar" }
57
- ]
58
- }
59
- ```
60
- </td>
61
- </tr >
36
+ <tbody >
37
+ <tr>
38
+ <th>Draft 2019-09</th>
39
+ <th>Draft 2020-12</th>
40
+ </tr>
41
+ <tr>
42
+ <td>
43
+ ```json
44
+ {
45
+ "items": [
46
+ { "$ref": "#/$defs/foo" },
47
+ { "$ref": "#/$defs/bar" }
48
+ ]
49
+ }
50
+ ```
51
+ </td>
52
+ <td>
53
+ ```json
54
+ {
55
+ "prefixItems": [
56
+ { "$ref": "#/$defs/foo" },
57
+ { "$ref": "#/$defs/bar" }
58
+ ]
59
+ }
60
+ ```
61
+ </td>
62
+ </tr>
63
+ </tbody >
62
64
</table >
63
65
64
66
### Closed tuple
65
67
<table >
66
- <tr >
67
- <th>Draft 2019-09</th>
68
- <th>Draft 2020-12</th>
69
- </tr >
70
- <tr >
71
- <td>
72
- ```json
73
- {
74
- "items": [
75
- { "$ref": "#/$defs/foo" },
76
- { "$ref": "#/$defs/bar" }
77
- ],
78
- "additionalItems": false
79
- }
80
- ```
81
- </td>
82
- <td>
83
- ```json
84
- {
85
- "prefixItems": [
86
- { "$ref": "#/$defs/foo" },
87
- { "$ref": "#/$defs/bar" }
88
- ],
89
- "items": false
90
- }
91
- ```
92
- </td>
93
- </tr >
68
+ <tbody >
69
+ <tr>
70
+ <th>Draft 2019-09</th>
71
+ <th>Draft 2020-12</th>
72
+ </tr>
73
+ <tr>
74
+ <td>
75
+ ```json
76
+ {
77
+ "items": [
78
+ { "$ref": "#/$defs/foo" },
79
+ { "$ref": "#/$defs/bar" }
80
+ ],
81
+ "additionalItems": false
82
+ }
83
+ ```
84
+ </td>
85
+ <td>
86
+ ```json
87
+ {
88
+ "prefixItems": [
89
+ { "$ref": "#/$defs/foo" },
90
+ { "$ref": "#/$defs/bar" }
91
+ ],
92
+ "items": false
93
+ }
94
+ ```
95
+ </td>
96
+ </tr>
97
+ </tbody >
94
98
</table >
95
99
96
100
### Tuple with constrained additional items
97
101
<table >
98
- <tr >
99
- <th>Draft 2019-09</th>
100
- <th>Draft 2020-12</th>
101
- </tr >
102
- <tr >
103
- <td>
104
- ```json
105
- {
106
- "items": [
107
- { "$ref": "#/$defs/foo" },
108
- { "$ref": "#/$defs/bar" }
109
- ],
110
- "additionalItems": { "$ref": "#/$defs/baz" }
111
- }
112
- ```
113
- </td>
114
- <td>
115
- ```json
116
- {
117
- "prefixItems": [
118
- { "$ref": "#/$defs/foo" },
119
- { "$ref": "#/$defs/bar" }
120
- ],
121
- "items": { "$ref": "#/$defs/baz" }
122
- }
123
- ```
124
- </td>
125
- </tr >
102
+ <tbody >
103
+ <tr>
104
+ <th>Draft 2019-09</th>
105
+ <th>Draft 2020-12</th>
106
+ </tr>
107
+ <tr>
108
+ <td>
109
+ ```json
110
+ {
111
+ "items": [
112
+ { "$ref": "#/$defs/foo" },
113
+ { "$ref": "#/$defs/bar" }
114
+ ],
115
+ "additionalItems": { "$ref": "#/$defs/baz" }
116
+ }
117
+ ```
118
+ </td>
119
+ <td>
120
+ ```json
121
+ {
122
+ "prefixItems": [
123
+ { "$ref": "#/$defs/foo" },
124
+ { "$ref": "#/$defs/bar" }
125
+ ],
126
+ "items": { "$ref": "#/$defs/baz" }
127
+ }
128
+ ```
129
+ </td>
130
+ </tr>
131
+ </tbody >
126
132
</table >
127
133
128
134
## $dynamicRef and $dynamicAnchor
@@ -149,6 +155,7 @@ used as the starting point for dynamic resolution.
149
155
Here's how you would covert a schema using ` $recursiveRef ` to use ` $dynamicRef ` .
150
156
151
157
<table >
158
+ <tbody >
152
159
<tr >
153
160
<th>Draft 2019-09</th>
154
161
<th>Draft 2020-12</th>
@@ -209,6 +216,7 @@ Here's how you would covert a schema using `$recursiveRef` to use `$dynamicRef`.
209
216
```
210
217
</td >
211
218
</tr >
219
+ </tbody >
212
220
</table >
213
221
214
222
@@ -224,35 +232,37 @@ that has some item matching one schema and everything else matching another
224
232
schema.
225
233
226
234
<table >
227
- <tr >
228
- <th>Draft 2019-09</th>
229
- <th>Draft 2020-12</th>
230
- </tr >
231
- <tr >
232
- <td>
233
- ```json
234
- {
235
- "type": "array",
236
- "contains": { "type": "string" },
237
- "items": {
238
- "anyOf": [
239
- { "type": "string" },
240
- { "type": "number" }
241
- ]
235
+ <tbody >
236
+ <tr>
237
+ <th>Draft 2019-09</th>
238
+ <th>Draft 2020-12</th>
239
+ </tr>
240
+ <tr>
241
+ <td>
242
+ ```json
243
+ {
244
+ "type": "array",
245
+ "contains": { "type": "string" },
246
+ "items": {
247
+ "anyOf": [
248
+ { "type": "string" },
249
+ { "type": "number" }
250
+ ]
251
+ }
242
252
}
243
- }
244
- ```
245
- </ td>
246
- <td>
247
- ```json
248
- {
249
- " type": "array" ,
250
- "contains ": { "type": "string " },
251
- "unevaluatedItems": { "type": "number" }
252
- }
253
- ```
254
- </td >
255
- </tr >
253
+ ```
254
+ </td>
255
+ < td>
256
+ ```json
257
+ {
258
+ "type": "array",
259
+ "contains": { " type": "string" } ,
260
+ "unevaluatedItems ": { "type": "number " }
261
+ }
262
+ ```
263
+ </td>
264
+ </tr >
265
+ </tbody >
256
266
</table >
257
267
258
268
Unfortunately, this change means you may not be able to use ` contains ` in some
@@ -463,7 +473,8 @@ embedded schemas using `$defs`. Here's what the bundled schema would look like.
463
473
Here are a few things you might notice from this example.
464
474
465
475
1 . No ` $ref ` s were modified. Even local references are unchanged.
466
- 2 . ` https://example.com/schema/common#/$defs/unsignedInt ` got pulled in with the
476
+ 2 . ` https://example.com/schema/common#/ `
477
+ ` $defs/unsignedInt ` got pulled in with the
467
478
common schema even though it isn't used. It's allowed to trim out the extra
468
479
definitions, but not necessary.
469
480
3 . ` https://example.com/schema/address ` doesn't declare a ` $schema ` . Because it
0 commit comments