|
2 | 2 | title: JSON Schema 2020-12 Release Notes
|
3 | 3 | layout: page
|
4 | 4 | ---
|
| 5 | +The previous draft (2019-09) introduced a lot of new concepts including |
| 6 | +`$recursiveRef`/`$recursiveAnchor`, `unevaluatedProperties`/`unevaluatedItems`, |
| 7 | +vocabularies, and more. Since then, these new features have seen multiple |
| 8 | +implementations and usage in real schemas. This draft is mostly dedicated to |
| 9 | +changes related to applying the lessons we've learned about implementing and |
| 10 | +using these new features in the wild. |
| 11 | + |
| 12 | +This document attempts to put information most useful to schema authors toward |
| 13 | +the top and information for implementation authors toward the bottom. |
| 14 | + |
5 | 15 | ## Changes to items and additionalItems
|
6 | 16 | The keywords used for defining arrays and tuples have been redesigned to help
|
7 | 17 | lower the learning curve for JSON Schema. Since the `items` keyword was used for
|
@@ -277,6 +287,18 @@ Given this schema, the instance `["a", "b", "ccc"]` will fail because `"ccc"` is
|
277 | 287 | considered unevaluated and fails the `unevaluatedItems` keyword like it did in
|
278 | 288 | previous drafts.
|
279 | 289 |
|
| 290 | +## Regular Expressions |
| 291 | +Regular expressions are now required to support unicode characters. Previously, |
| 292 | +this was unspecified and implementations may or may not support this unicode in |
| 293 | +regular expressions. |
| 294 | + |
| 295 | +## Media Type Changes |
| 296 | +JSON Schema defines two media types, `application/schema+json` and |
| 297 | +`application/schema-instance+json`. This draft drops support for the `schema` |
| 298 | +media type parameter. It's caused a lot of confusion and disagreement. Since we |
| 299 | +haven't seen any evidence of anyone actually using it, it was decided to remove |
| 300 | +it for now. |
| 301 | + |
280 | 302 | ## Embedded Schemas and Bundling
|
281 | 303 | In Draft 2019-09, the meaning of `$id` in a sub-schema changed from indicating a
|
282 | 304 | base URI change within the current schema to indicating an embedded schema
|
@@ -433,6 +455,11 @@ document it's embedded in. That's allowed.
|
433 | 455 | other schemas and only needs to be included once. It isn't necessary for
|
434 | 456 | bundlers to embed a schema inside another embedded schema.
|
435 | 457 |
|
| 458 | +## Annotations |
| 459 | +Implementations that collect annotations should now include annotations for |
| 460 | +unknown keywords in the "verbose" output format. The annotation value for an |
| 461 | +unknown keyword is the keyword's value. |
| 462 | + |
436 | 463 | ## Vocabulary Changes
|
437 | 464 | The `unevaluatedProperties` and `unevaluatedItems` keywords have been moved from
|
438 | 465 | the applicator vocabulary to their own vocabulary designated which is required
|
|
0 commit comments