Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: validation against metaschema #513

Open
rhiaro opened this issue Jan 2, 2024 · 2 comments
Open

Tests: validation against metaschema #513

rhiaro opened this issue Jan 2, 2024 · 2 comments
Assignees
Labels
bug tests Schema tests

Comments

@rhiaro
Copy link
Collaborator

rhiaro commented Jan 2, 2024

The additional properties added to the metaschema are codelist, openCodelist, version and propertyOrder. Only version can be validated because it sits at the top level - for any nested properties, the validator ignores our metaschema and defers back to the 2020-12 metaschema.

To fix this, I think we need to also redefine $ref in our metaschema, or possibly use the workaround for the jsonschema library in python-jsonschema/jsonschema#994 (comment).

See also: python-jsonschema/jsonschema#1061

Maybe an alternative fix would be to turn the BODS metaschema into a vocabulary but I can't see that the python-jsonschema library supports this yet.

@rhiaro rhiaro added bug tests Schema tests labels Jan 2, 2024
@kd-ods kd-ods assigned kd-ods and rhiaro and unassigned kd-ods Feb 16, 2024
@kd-ods
Copy link
Collaborator

kd-ods commented Mar 5, 2024

@rhiaro - is this an issue for the future? It seems like something where a 'wait and see' policy could be enough for now.

@jpmckinney
Copy link

FYI, OCDS creates custom metaschema here (for Draft 4, but hopefully similar for newer JSON Schema versions): https://github.com/open-contracting/standard-maintenance-scripts/blob/bec9acc09c1e5f1ca84b420ab8bbcf8a5cbed79d/tests/test_json.py#L247

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug tests Schema tests
Projects
Status: 🔖 Ready
Development

No branches or pull requests

3 participants