-
Notifications
You must be signed in to change notification settings - Fork 14
Description
$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
$schemaboth in the API and in the Admin of Objecttypes - add related data migration for objecttypes without
$schemaattribute