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

The schemas at packages/core/src/ruleset/meta are invalid #2787

Open
jviotti opened this issue Feb 25, 2025 · 2 comments · May be fixed by #2788
Open

The schemas at packages/core/src/ruleset/meta are invalid #2787

jviotti opened this issue Feb 25, 2025 · 2 comments · May be fixed by #2788

Comments

@jviotti
Copy link

jviotti commented Feb 25, 2025

Hey there! JSON Schema TSC member here. I'm trying to ingest the JSON Schemas maintained in this repository in my public JSON Schema registry (https://schemas.sourcemeta.com) (see sourcemeta/registry#146). While trying to do so, I uncovered a few problems with the schemas:

Maybe there are more issues, but at least those ones seemed to be the obvious ones making my tooling choke.

If I may ask, are you testing or validating those schemas at all right now? Just curious if there is a specific implementation that is somehow allowing the current use of invalid keywords.

I also recommend taking a look at my JSON Schema CLI tool (https://github.com/sourcemeta/jsonschema). Many projects use it on CI/CD (we have an easy to use GitHub Action for it) to:

  • Validate schemas against their meta schemas (the metaschema command)
  • Lint schemas (the lint command)
  • Run unit tests against the schemas (the test command)

Could be useful to avoid issues in the future! Happy to assist in all of the above!

@jviotti
Copy link
Author

jviotti commented Feb 25, 2025

I guess one option is to make the schemas valid Draft 7, but might actually be easier to upgrade them to JSON Schema 2020-12.

jviotti added a commit to jviotti/spectral that referenced this issue Feb 25, 2025
Plus add a GitHub Action that uses `sourcemeta/jsonschema` to perform
some basic smoke tests to prevent regressions.

Fixes: stoplightio#2787
Signed-off-by: Juan Cruz Viotti <[email protected]>
@jviotti
Copy link
Author

jviotti commented Feb 25, 2025

I sent a PR to do enough to make the schemas work as 2020-12 schemas: #2788

jviotti added a commit to jviotti/spectral that referenced this issue Feb 25, 2025
Plus add a GitHub Action that uses `sourcemeta/jsonschema` to perform
some basic smoke tests to prevent regressions.

Fixes: stoplightio#2787
Signed-off-by: Juan Cruz Viotti <[email protected]>
jviotti added a commit to jviotti/spectral that referenced this issue Feb 25, 2025
Plus add a GitHub Action that uses `sourcemeta/jsonschema` to perform
some basic smoke tests to prevent regressions.

Fixes: stoplightio#2787
Signed-off-by: Juan Cruz Viotti <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant