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 haven't found a public API way to give the new dialect to the referencing.jsonschema._SPECIFICATIONS. (As we do not change the referencing behaviour, it may or not may be okay to use specification=jsonschema.DRAFT202012., it just feels not right as the meta schema is available.
The other concern is that adding the vocabularies does not seem to change assertion checking in the implementation, only adding format_checker=Draft202012Validator.FORMAT_CHECKER decides this. According to my (limited) understanding adding the vocabulary of format-assertion should enable the checks by default. Okay - Draft202012Validator is for the Draft 2020-12 where formation assertion is off by default, but can be enabled.
If it already works, then an example of how to create a new meta schema (dialect) that has format-assertion enable like it should be done in accordance with Draft 2020-12 would be very helpful.
The text was updated successfully, but these errors were encountered:
What is the supported way to check a JSON file via a (local) schema that wants to enforce the format assertions?
It is already supported?
My example is what oasis-tcs/csaf#962 is trying to do.
https://github.com/oasis-tcs/csaf/blob/78f4b61ba2ba05d375a452ef7938abde16949457/csaf_2.1/json_schema/csaf_json_schema.json#L2
sets a custom dialect:
which locally is
https://github.com/oasis-tcs/csaf/blob/78f4b61ba2ba05d375a452ef7938abde16949457/csaf_2.1/json_schema/meta_json_schema.json
and just aims for adding the necessary vocabulary to treat formats as assertion.
However as can be seen in oasis-tcs/csaf#962 (comment) and above, that is needs to explicitly set
jsonschema.DRAFT202012
to just add theI haven't found a public API way to give the new dialect to the
referencing.jsonschema._SPECIFICATIONS
. (As we do not change the referencing behaviour, it may or not may be okay to usespecification=jsonschema.DRAFT202012
., it just feels not right as the meta schema is available.The other concern is that adding the vocabularies does not seem to change assertion checking in the implementation, only adding
format_checker=Draft202012Validator.FORMAT_CHECKER
decides this. According to my (limited) understanding adding the vocabulary of format-assertion should enable the checks by default. Okay - Draft202012Validator is for the Draft 2020-12 where formation assertion is off by default, but can be enabled.If it already works, then an example of how to create a new meta schema (dialect) that has format-assertion enable like it should be done in accordance with Draft 2020-12 would be very helpful.
The text was updated successfully, but these errors were encountered: