Closed davidlatwe closed 4 years ago
Nice one! For completeness, our vendored version of jsonschema
won't actually take this into account, but once/if we update then these constraints should kick in? Or do they work already?
Yeah, the keyword const
was not working, for example, you could change the container id from pyblish.avalon.container
into arbitrary string and it still pass the validation.
For example:
from avalon.vendor import jsonschema
data = {"foo": "bar"}
schema = {"properties": {"foo": {"const": "not-bar"}}}
jsonschema.validate(data, schema)
# No error raised
Aaah so the current schema was using a too new keyword, and this brings it back to the version we're actually using to validate. Gotcha, that makes sense. Happy with this!
Changes
Specifying our schema draft version to version 4, because the module
jsonschema
we vendorized was only supported up to version 4.Change keyword
const
toenum
, becauseconst
was introduced in JSON schema Draft 6.You may see #350 for detail :)