fix(core): make JSON Schemas at packages/core/src/ruleset/meta valid#2788
fix(core): make JSON Schemas at packages/core/src/ruleset/meta valid#2788jviotti wants to merge 3 commits intostoplightio:developfrom
packages/core/src/ruleset/meta valid#2788Conversation
|
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. |
packages/core/src/ruleset/meta validpackages/core/src/ruleset/meta valid
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 <jv@jviotti.com>
|
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 |
We are using JSONSchema draft 2020-12, which needs ajv/dist/2020. Ref: stoplightio#2788 (comment)

Plus add a GitHub Action that uses
sourcemeta/jsonschemato perform some basic smoke tests to prevent regressions.Fixes: #2787