Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.

meta: refactor schema versioning to improve errors #385

Merged
merged 1 commit into from
Sep 14, 2022

Conversation

ssbarnea
Copy link
Member

@ssbarnea ssbarnea commented Sep 14, 2022

This greatly improves the quality of the validating error messages by making use of if/then/else instead of anyOf, as most validators are able to provide less confusing validation errors with these (python-jsonschema and ajv).

Improvement of error messages comes with a minor downside, as from now on schema validation for meta would not pass on empty files. Users will have to either put real content in meta files to pass schema validation, such as version at least to pass. That was needed for
technical reasons as without it the error messages would be considerably less easy to understand.

Related: python-jsonschema/jsonschema#1002

@ssbarnea ssbarnea requested a review from a team as a code owner September 14, 2022 09:53
@ssbarnea ssbarnea added the bug Something isn't working label Sep 14, 2022
This greatly improves the quality of the validating error messages.

Improvement of error messages comes with a minor downside, as from
now on schema validation for meta would not pass on empty files. Users
will have to either put real content in meta files to pass schema
validation, such as version at least to pass. That was needed for
technical reasons as without it the error messages would be
considerably less easy to understand.

Related: python-jsonschema/jsonschema#1002
@ssbarnea ssbarnea merged commit 20f13a9 into ansible:main Sep 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants