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 schemas and fix them accordingly #220

Merged
merged 1 commit into from
May 14, 2024

Conversation

afrittoli
Copy link
Contributor

Changes

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: #211

Cherry-pick of #219

Submitter Checklist

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

Version Notes

Event Versions

All event schemas have been updated to fix the $ref to the links schemas.
Normally this would require bumping all event versions, and we do that in the main branch for v0.5.0.

However, for this patch release, consider the following points:

  • All event versions were already bumped as part of v0.4.0
  • The v0.4.0 version was only recently released
  • No v0.4.0 SDK has been released yet
  • If anyone attempted to use v0.4.0 between release and now, they would have failed to use links because of the invalid schema $ref
  • If we bump event versions in this PR we will have to do so again when fixing the camel case, causing a lot of rebase pain for the PRs needed for v0.4.1

I think that for v0.4.1 it's not worth bumping event versions again. We should instead focus on getting all v0.4.1 fixed merged soon-ish, so that we may make a new release and finish the work on the SDKs.

Spec Version

The spec version has to be bumped to v0.4.1.
Since we will need several PRs for v0.4.1, I propose that all PRs do not update versions, and we make the version update in one last PR before releasing.

@afrittoli afrittoli requested a review from a team as a code owner May 10, 2024 13:59
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 <[email protected]>
@afrittoli afrittoli force-pushed the check_jsonschema_v04 branch from 7285f0d to 3c0100b Compare May 10, 2024 14:00
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.

Same comments here from #219

@afrittoli afrittoli merged commit f1dbd63 into cdevents:spec-v0.4 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
Development

Successfully merging this pull request may close these issues.

3 participants