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
$schema` attribute defines which version of the JSON Schema specification should be used to validate both schema and the JSON.
It's not a required attribute, and the default version is implementation-specific according to the JSON schema standard.
For us it means that different versions of jsonschema python library have different default versions with different sets of validators.
Therefore Objecttype.jsonschema can be valid for one API and not valid for another API, which uses different jsonschema version. Here is an example, when it happened with ObjectTypes and Open Zaak https://sentry.maykinmedia.nl/organizations/maykin-media/issues/344810/?project=149&query=is%3Aunresolved
Moreover it's possible that the same Objecttype.schema can stop being valid as we change jsonschema lib version in Objecttypes.
To prevent all these hard-identified errors let's make $schema attribute required for Objecttype.jsonschema
Tasks:
add validator for $schema both in the API and in the Admin of Objecttypes
add related data migration for objecttypes without $schema attribute
The text was updated successfully, but these errors were encountered:
annashamray
changed the title
My $schema attribute required for json schemas in Object Types API
Make $schema required for json schemas in Object Types API
Dec 21, 2023
This would be useful for Open Forms as well, as we parse the JSON Schemas and have to assume the $schema matches the latest draft if it is not present.
$schema` attribute defines which version of the JSON Schema specification should be used to validate both schema and the JSON.
It's not a required attribute, and the default version is implementation-specific according to the JSON schema standard.
For us it means that different versions of
jsonschema
python library have different default versions with different sets of validators.Therefore Objecttype.jsonschema can be valid for one API and not valid for another API, which uses different
jsonschema
version. Here is an example, when it happened with ObjectTypes and Open Zaak https://sentry.maykinmedia.nl/organizations/maykin-media/issues/344810/?project=149&query=is%3AunresolvedMoreover it's possible that the same Objecttype.schema can stop being valid as we change
jsonschema
lib version in Objecttypes.To prevent all these hard-identified errors let's make
$schema
attribute required for Objecttype.jsonschemaTasks:
$schema
both in the API and in the Admin of Objecttypes$schema
attributeThe text was updated successfully, but these errors were encountered: