Draft-06 Release Notes¶
Release notes for migrating from zyp-04 and fge-00 (draft-04) to wright-01 (draft-06).
Note that draft-07 core and validation are backwards-compatible with draft-06. For more information, see that draft's migration notes.
- Q: What are the changes between draft-04 and draft-06?
- Q: What happened to draft-05?
- Q: What happened to all the discussions around re-using schemas with "additionalProperties"?
Q: What are the changes between draft-04 and draft-06?¶
|replaced by ||no longer easily confused with instance properties named |
|replaces ||behavior is identical, |
|only allowed where a schema is expected||it is now possible to describe instance properties named |
|changed from a boolean to a number to be consistent with the principle of keyword independence||wherever one of these would be true before, change the value to the corresponding |
|definition of ||in draft-04, |
Additions and backwards-compatible changes¶
|booleans as schemas||allowable anywhere, not just |
|added||takes a schema which validates the names of all properties rather than their values|
|added||array keyword that passes validation if its schema validates at least one array item|
|added||more readible form of a one-element |
|allows an empty array||an empty array indicates that no properties are required|
|allows an empty array for property dependencies||an empty array indicates that there are no dependencies for the given property|
|added||allows relative URI references per RFC 3986; see the section below about |
|added||indicates an RFC 6570 conforming URI Template value, as is used in JSON Hyper-Schema for |
|added||indicates a JSON Pointer value such as |
|added||array of examples with no validation effect; the value of |
While not technically a change, the behavior of the
"uri" format was not clearly explained and often implemented and used incorrectly (including in the draft-04 meta-schema).
"uri" should only be used when an absolute URI (starting with a scheme) is required.
When a relative path, fragment, or any other style of URI Reference (per RFC 3986) is allowable, use
Implementations offering a translation from draft-04 to draft-06 may want to offer an option to convert
"uri" formats to
"uri-reference", although any such option should be disabled by default for strict conformance.
Q: What happened to draft-05?¶
The draft-05 core and validation specifications were intended to be more clear and readable rewrites of draft-04, to give us a strong base for draft-06 changes. Implementors should not implement or advertise support for "draft-05".
Implementations that supported "draft-05" by implementing proposals from right after the publication of draft-04 should either remove that support or give it a different name to avoid confusion.
Q: What happened to all the discussions around re-using schemas with
There are several competing proposals for making the re-use of schemas that set
"additionalProperties" to something other than
true. Most people specifically care about the case where it is
false, but the same behavior occurs with any non-
All of the proposals in this area will be the focus of draft-08. While we made progress in eliminating some options during draft-07, the remaining divisions are deep enough to warrant making it the primary focus of a draft (draft-07's primary focus is Hyper-Schema).
The difficulty is that if you attempt to do this:
Validation will always fail for any non-empty object instance.
"additionalProperties" only knows about immediately adjacent
"patternProperties", in order to ensure that each subschema means the same thing whether it is being used with another subschema or on its own.
So in this example, if the instance has a "bar" property, it will fail the first subschema because "bar" is not "foo". If it has a "foo" property, it will fail the second subschema because "foo" is not "bar". And any other property will fail both schemas.
A workaround is available with the new
This will allow an object with either "foo" or "bar" or both, but will fail validation if any other property is present. The
"allOf" ensures that "foo" and "bar" will each be validated correctly if present, while the
"anyOf" allows for properties with names in either allowed set, but forbids properties that are not listed in at least one set.
It does require duplicating the names, and the awkward use of both an
"anyOf", but it is less repetition than other options, and can be re-used fairly robustly even if the "foo" and "bar" schemas are in separate files managed by a different person or organization.