fix(core): make JSON Schemas at `packages/core/src/ruleset/meta` valid
Plus add a GitHub Action that uses sourcemeta/jsonschema to perform some basic smoke tests to prevent regressions.
Fixes: https://github.com/stoplightio/spectral/issues/2787
I tried to setup a basic GitHub Action to prevent regressions here, but as I sent the PR, I'm now realising you use CircleCI. Happy to revise the PR to just fix the schemas.
Ah, looking at the CircleCI failures, you seem to be using AJV (https://ajv.js.org). That explains why the schemas were invalid. AJV, despite being quite popular, is one of the least compliant JSON Schema validators we are aware of, with significant deviations from the specification. See Bowtie, the official JSON Schema project that ranks implementations by compliance and the amount of failures we record for AJV across versions of JSON Schema: https://bowtie.report/#/implementations/js-ajv.
I also touched on AJV on my talk at the last JSON Schema Conference (see https://www.youtube.com/watch?v=wJ7bK22n3IU) and how it can lead you to inadvertently write invalid schemas.
the reason you're seeing the failure for $id ... 2020-12 is because Ajv requires a different import from the base version. The default import is for draft-07
If you want to use 2020-12, you need to import ajv/dist/2020