You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been looking at adding support for draft-06 and draft-07 recently. This should be very doable, but it seemed like at least a good idea to make a todo public list and maybe have a public discussion about some implementation details. Draft-06 introduces some backwards incompatible changes, most notably changes to exclusiveMinimum, exclusiveMaximum, id vs $id and the possibility to have a property named $ref.
The current test setup is a bit of a PITA to maintain (especially now with different draft versions), so it's probably best to ditch the current test suite and create one that directly uses the test files as defined in the official test suite without manual transformation like now. The current setup has the advantage however that errors are checked more thoroughly than just being valid or invalid however.
Add support for handling different versions of JSON Schema. Detection of the version could be done based on the $schema keyword. Default to draft-04 for backwards compatibility.
Add some new interfaces to different loaders so a specific draft be enforced upon schema loading time instead of relying on the $schema keyword. This would probably be needed for testing, but some developers might also want to manually enforce it.
Add support for propertyNames, contains and const
Change some behaviour related to edge cases (requires, dependencies and using booleans as schemas) I'd not be surprised if gojsonschema already handles some of these correctly by accident.
A lot of new metadata fields are added like examples, $comment, readOnly, writeOnly, contentMediaType, contentMediaEncoding, etc. The current metadata fields like title and description are parsed, but nothing is done with the data. If we implement Feature Request: Validate input schema against metaschema #174, there is really no need to even look at these type of fields explicitly since they are not used for validation.
Add a bunch off new format checkers. Both draft-06 and draft-07 defined a lot of them. It happens that regex, date and time were already part of draft-03 and also implemented here.
Note that the added emphasis on meta-data is likely to continue (but not necessarily all in the validation spec). json-schema-org/json-schema-spec#530 tracks formalizing how that should work and will likely result in more formal guidance on annotations / metadata collection in draft-08. You might want to keep that in mind while adding support now.
Your top-level repo title says it only supports draft-04
I only have commit rights, so I can't edit the description. @xeipuuv, could you change the description for the repo to include draft v6 and dravt v7 support?
I've been looking at adding support for draft-06 and draft-07 recently. This should be very doable, but it seemed like at least a good idea to make a todo public list and maybe have a public discussion about some implementation details. Draft-06 introduces some backwards incompatible changes, most notably changes to
exclusiveMinimum
,exclusiveMaximum
,id
vs$id
and the possibility to have a property named$ref
.$schema
keyword. Default to draft-04 for backwards compatibility.$schema
keyword. This would probably be needed for testing, but some developers might also want to manually enforce it.propertyNames
,contains
andconst
requires
,dependencies
and using booleans as schemas) I'd not be surprised if gojsonschema already handles some of these correctly by accident.examples
,$comment
,readOnly
,writeOnly
,contentMediaType
,contentMediaEncoding
, etc. The current metadata fields liketitle
anddescription
are parsed, but nothing is done with the data. If we implement Feature Request: Validate input schema against metaschema #174, there is really no need to even look at these type of fields explicitly since they are not used for validation.regex
,date
andtime
were already part of draft-03 and also implemented here.For anyone interested here are the release notes for draft-06 and draft-07
The text was updated successfully, but these errors were encountered: