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

Validate jsonschemas and fix them accordingly #219

Merged
merged 2 commits into from
May 14, 2024

Conversation

afrittoli
Copy link
Contributor

@afrittoli afrittoli commented May 10, 2024

Changes

Commit 1: Validate schemas and fix them accordingly

Add validation of jsonschemas to our CI.
The links and embeddedlinks schemas where invalid,
as well as the references to them from the event
schemas, so fixing all those to let CI pass.

Switch to ajv for example validation, which allows for
validation of both JSON documents as well as schemas.

ajv let users load references schemas from files into
the tool offline databases, which enables offline
validation of unpublished schemas.

Since ajv is javascript, update the GitHub action
workflow to javascript.

Fixes: #208
Fixes: #209
Fixes: #211

Commit 2: Bump all event versions

Since all references to the link schemas have been updated, we need
to bump all event versions too.

This as usual is automated:

ls examples | while read aa; do sp="$(echo ${aa%.*} | tr "_" ".")"; ./tools/event-version.sh -u $sp -s; done

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

@afrittoli afrittoli requested a review from a team as a code owner May 10, 2024 11:21
@afrittoli afrittoli force-pushed the check_jsonschemas branch 8 times, most recently from f806d6f to 152d3f0 Compare May 10, 2024 12:42
afrittoli added 2 commits May 10, 2024 13:58
Add validation of jsonschemas to our CI.
The links and embeddedlinks schemas where invalid,
as well as the references to them from the event
schemas, so fixing all those to let CI pass.

Switch to ajv for example validation, which allows for
validation of both JSON documents as well as schemas.

ajv let users load references schemas from files into
the tool offline databases, which enables offline
validation of unpublished schemas.

Since ajv is javascript, update the GitHub action
workflow to javascript.

Fixes: cdevents#208
Fixes: cdevents#211

Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
Since all references to the link schemas have been updated, we need
to bump all event versions too.

This as usual is automated:

ls examples | while read aa; do sp="$(echo ${aa%.*} | tr "_" ".")"; ./tools/event-version.sh -u $sp -s; done

Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
@afrittoli afrittoli force-pushed the check_jsonschemas branch from 152d3f0 to 7d138a9 Compare May 10, 2024 12:58
@afrittoli afrittoli changed the title Check jsonschemas Validate jsonschemas and fix them accordingly May 10, 2024
Copy link
Contributor

@xibz xibz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. My suggestions are very minor, and mostly a question on the separation of the validation loops for links versus not, so Im okay with merging this as is, but the potential look cleanup may be really nice and easier to maintain

.github/workflows/main.yml Show resolved Hide resolved
tools/validate.sh Show resolved Hide resolved
@afrittoli afrittoli merged commit e48229d into cdevents:main May 14, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants