Repository navigation
feat(reference): add support for JSON Schema 2020-12 - #5284
robert-hebel-sb merged 3 commits into
Conversation
f873142 to
9fb2d6a
Compare
9fb2d6a to
7a87d29
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Dereferencing with a precomputed reference set can traverse and return the wrong document, while Boolean-root detection and percent-encoded anchor handling also reject valid schemas or references.
4 open issues
What changed in this PR
Adds standalone JSON Schema 2020-12 support to apidom-reference, building on the parser adapters from #5286.
Changes:
- Adds JSON/YAML parsers and resolve, dereference, and no-op bundle strategies.
- Registers the integrations, exposes package entry points, and documents supported behavior.
- Adds namespace helpers and fixtures covering references, schema keywords, errors, cycles, and OpenAPI interoperability.
Paths below use these abbreviations:
R:packages/apidom-reference;N:packages/apidom-ns-json-schema-2020-12.RF/DF:R/test/{resolve|dereference}/strategies/json-schema-2020-12/json-schema/fixtures.BF:R/test/bundle/strategies/json-schema-2020-12/json-schema/fixtures.O31/O32:R/test/dereference/strategies/openapi-{3-1|3-2}/schema-object.
| File | Description |
|---|---|
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/unresolvable-reference/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/unresolvable-reference/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/max-depth/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/max-depth/ex3.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/max-depth/ex2.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/max-depth/ex1.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/invalid-pointer/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/invalid-pointer/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/internal-only/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/internal-external/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/internal-external/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/infinite-recursion/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/indirect-internal-circular/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/indirect-external-circular/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/indirect-external-circular/ex3.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/indirect-external-circular/ex2.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/indirect-external-circular/ex1.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/ignore-external/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/ignore-external/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/external-only/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/external-only/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/external-indirections/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/external-indirections/ex3.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/external-indirections/ex2.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/external-indirections/ex1.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/external-circular-dependency/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/external-circular-dependency/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/direct-internal-circular/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/direct-external-circular/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/direct-external-circular/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/cycle-internal/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/cycle-internal-external/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/cycle-internal-external/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/cycle-external/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/cycle-external/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$ref-urn/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$ref-urn-pointer/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$ref-urn-$anchor/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url-resolvable/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url-resolvable/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url-resolvable/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-external/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-external/nested/nested/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-external/nested/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-enclosing/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-enclosing/nested/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-direct/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-direct/nested/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$id-unresolvable/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$anchor-not-found/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$anchor-not-found/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$anchor-internal/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$anchor-external/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/resolve/strategies/json-schema-2020-12/json-schema/fixtures/$anchor-external/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/parse/parsers/json-schema-yaml-2020-12/fixtures/sample-schema.yaml | Updated as part of this pull request. |
| packages/apidom-reference/test/parse/parsers/json-schema-json-2020-12/fixtures/sample-schema.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/openapi-3-2/schema-object/index.ts | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/openapi-3-2/schema-object/fixtures/external-json-schema-2020-12-documents/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/openapi-3-2/schema-object/fixtures/external-json-schema-2020-12-documents/ex.yaml | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/openapi-3-2/schema-object/fixtures/external-json-schema-2020-12-documents/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/openapi-3-2/schema-object/fixtures/external-json-schema-2020-12-documents/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/openapi-3-1/schema-object/index.ts | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/openapi-3-1/schema-object/fixtures/external-json-schema-2020-12-documents/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/openapi-3-1/schema-object/fixtures/external-json-schema-2020-12-documents/ex.yaml | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/openapi-3-1/schema-object/fixtures/external-json-schema-2020-12-documents/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/openapi-3-1/schema-object/fixtures/external-json-schema-2020-12-documents/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/yaml/root.yaml | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/yaml/ex.yaml | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/yaml/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/unresolvable-reference/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/root-ref/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/root-ref/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/root-ref-boolean/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/reference-errors/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/reference-errors/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/reference-errors/broken.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/reference-errors-none/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/reference-errors-none/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/merging-keywords/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/merging-keywords/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/merging-keywords/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/max-depth/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/max-depth/ex3.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/max-depth/ex2.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/max-depth/ex1.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/keywords/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/keywords/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/invalid-pointer/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/internal-only/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/internal-only/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/internal-external/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/internal-external/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/internal-external/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/infinite-recursion/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/infinite-recursion/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/indirect-internal/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/indirect-internal/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/indirect-internal-circular/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/indirect-internal-circular/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/indirect-external-circular/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/indirect-external-circular/ex3.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/indirect-external-circular/ex2.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/indirect-external-circular/ex1.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/indirect-external-circular/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/ignore-external/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/ignore-external/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/ignore-external/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/external-only/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/external-only/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/external-only/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/external-indirections/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/external-indirections/ex3.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/external-indirections/ex2.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/external-indirections/ex1.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/external-indirections/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/external-circular-dependency/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/external-circular-dependency/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/external-circular-dependency/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/direct-internal-circular/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/direct-external-circular/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/direct-external-circular/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/direct-external-circular/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/cycle-internal/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/cycle-internal-in-array/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/cycle-internal-external/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/cycle-internal-external/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/cycle-internal-advanced/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/cycle-external/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/cycle-external/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/boolean-json-schema/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/boolean-json-schema/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-urn/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-urn/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-urn-unresolvable/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-urn-pointer/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-urn-pointer/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-urn-$anchor/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-urn-$anchor/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url-unresolvable/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url-resolvable/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url-resolvable/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url-resolvable/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url-relative-reference/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url-relative-reference/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url-pointer/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url-pointer/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url-path-override/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url-path-override/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url-$anchor/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-url-$anchor/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-$dynamicAnchor/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$ref-$dynamicAnchor/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-external/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-external/nested/nested/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-external/nested/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-external/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-external-circular-structures/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-external-circular-structures/nested/nested/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-external-circular-structures/nested/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-external-circular-structures/dereferenced.txt | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-enclosing/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-enclosing/nested/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-enclosing/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-direct/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-direct/nested/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$id-uri-direct/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$id-unresolvable/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$dynamicRef-json-pointer/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$dynamicRef-json-pointer/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$dynamicRef-boolean-schema/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$dynamicRef-boolean-schema/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$dynamicRef-$dynamicAnchor/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$dynamicRef-$dynamicAnchor/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$dynamicRef-$anchor/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$dynamicRef-$anchor/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$anchor-not-found/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$anchor-internal/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$anchor-internal/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$anchor-internal-no-embedding/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$anchor-internal-no-embedding/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$anchor-external/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$anchor-external/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/test/dereference/strategies/json-schema-2020-12/json-schema/fixtures/$anchor-external/dereferenced.json | Updated as part of this pull request. |
| packages/apidom-reference/test/bundle/strategies/json-schema-2020-12/json-schema/index.ts | Updated as part of this pull request. |
| packages/apidom-reference/test/bundle/strategies/json-schema-2020-12/json-schema/fixtures/internal-external/root.json | Updated as part of this pull request. |
| packages/apidom-reference/test/bundle/strategies/json-schema-2020-12/json-schema/fixtures/internal-external/ex.json | Updated as part of this pull request. |
| packages/apidom-reference/src/resolve/strategies/json-schema-2020-12/index.ts | Updated as part of this pull request. |
| packages/apidom-reference/src/parse/parsers/json-schema-yaml-2020-12/index.ts | Updated as part of this pull request. |
| packages/apidom-reference/src/parse/parsers/json-schema-json-2020-12/index.ts | Updated as part of this pull request. |
| packages/apidom-reference/src/dereference/strategies/json-schema-2020-12/util.ts | Updated as part of this pull request. |
| packages/apidom-reference/src/dereference/strategies/json-schema-2020-12/selectors/uri.ts | Updated as part of this pull request. |
| packages/apidom-reference/src/dereference/strategies/json-schema-2020-12/selectors/$anchor.ts | Updated as part of this pull request. |
| packages/apidom-reference/src/dereference/strategies/json-schema-2020-12/index.ts | Updated as part of this pull request. |
| packages/apidom-reference/src/configuration/saturated.ts | Updated as part of this pull request. |
| packages/apidom-reference/src/bundle/strategies/json-schema-2020-12/index.ts | Updated as part of this pull request. |
| packages/apidom-reference/README.md | Updated as part of this pull request. |
| packages/apidom-reference/package.json | Updated as part of this pull request. |
| packages/apidom-ns-json-schema-2020-12/test/traversal.ts | Updated as part of this pull request. |
| packages/apidom-ns-json-schema-2020-12/test/predicates.ts | Updated as part of this pull request. |
| packages/apidom-ns-json-schema-2020-12/src/predicates.ts | Updated as part of this pull request. |
| packages/apidom-ns-json-schema-2020-12/src/index.ts | Updated as part of this pull request. |
| packages/apidom-ns-json-schema-2020-12/README.md | Updated as part of this pull request. |
| package-lock.json | Updated as part of this pull request. |
Review effort: Balanced
|
|
||
| // assert by inspecting ApiDOM | ||
| const result = file.parseResult?.result; | ||
| return isJSONSchemaElement(result) && result.element === 'JSONSchema202012'; |
There was a problem hiding this comment.
Fixed in 32f7c16: canBundle also accepts isBooleanJsonSchemaElement roots. Added a test bundling a pre-computed refSet with a true root and no media type.
|
|
||
| // assert by inspecting ApiDOM | ||
| const result = file.parseResult?.result; | ||
| return isJSONSchemaElement(result) && result.element === 'JSONSchema202012'; |
There was a problem hiding this comment.
Fixed in 32f7c16: canDereference also accepts isBooleanJsonSchemaElement roots (resolve delegates to it, so it's covered too). Added tests for a Boolean parse result and for the Boolean result of root-$ref dereferencing passed to dereferenceApiDOM without a media type, plus canDereference unit tests (tagged vs. generic boolean).
| */ | ||
| export const uriToAnchor = (uri: string): string => { | ||
| const hash = getHash(uri); | ||
| return trimCharsStart('#', hash); |
There was a problem hiding this comment.
Fixed in 32f7c16: uriToAnchor now percent-decodes the fragment (malformed encoding is returned as is and rejected by isAnchor). Added a fixture with internal #%75ser-profile → $anchor and external ./ex.json#%75ser-name → $dynamicAnchor.
32f7c16 to
afce959
Compare
Export keyMap and getNodeType from the package index: the README already documented them, the JSON Schema 2020-12 dereference strategy traverses with them, and swagger-client's JSON Schema strategy imports them from the published package. Add isBooleanJsonSchemaElement, so that dereferencing can recognize Boolean JSON Schemas without depending on an OpenAPI namespace. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add parse parsers, and resolve, dereference and bundle strategies named json-schema-2020-12 for standalone JSON Schema 2020-12 documents, register them in the saturated configuration and export them, the dereference selectors included. The dereference strategy is the schema part of the OpenAPI 3.1 strategy: $ref resolves against $id base URIs and against $anchor and $dynamicAnchor plain name fragments, $dynamicRef is left in place as in OpenAPI 3.1, and errors collected with continueOnError are propagated once the document has been traversed. It accepts a parsed JSON Schema 2020-12 root without a media type, which apidom-ls doDeref relies on. When the root schema itself has a $ref, its replacement stays the result of the parse result. The bundle strategy returns the document unchanged, as for OpenAPI 3.1; compound-document bundling is deferred. In the saturated configuration the parsers claim a file only by a 2020-12 media type (detectContent: false). External files referenced from OpenAPI and AsyncAPI documents often declare a root $schema, and those strategies expect them as generic ApiDOM; tests prove that OpenAPI 3.1 and 3.2 documents referencing such files dereference as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- traverse the reference matching the dereferenced file instead of the refSet's root, so a pre-computed refSet with several documents dereferences the requested one - accept Boolean JSON Schema roots in the dereference and bundle strategies when no media type is given, so tagged `true`/`false` parse results no longer throw Unmatched*StrategyError - percent-decode plain name fragments so `$ref: '#%6Eode'` resolves `$anchor`/`$dynamicAnchor` Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
afce959 to
6ec900a
Compare


Phase 3 of 4 for JSON Schema 2020-12 support: apidom-reference.
Stacked on #5286 (the 2020-12 parser adapters accept an empty
$schemafragment); its base is that PR's branch until it merges.Changes
apidom-ns-json-schema-2020-12: exportkeyMapandgetNodeTypefrom the index (the README already documented them) and addisBooleanJsonSchemaElement.apidom-reference: parsersjson-schema-json-2020-12/json-schema-yaml-2020-12; resolve, dereference (withselectors/$anchorandselectors/uri) and bundle strategiesjson-schema-2020-12; registration insaturated.ts;optionalDependencies/devDependencies/exports; README.$refresolves against$idbase URIs and$anchor/$dynamicAnchorplain name fragments;$dynamicRefis left in place as in OpenAPI 3.1;continueOnErrorerrors match the OpenAPI 3.1 strategy; a parsed JSON Schema 2020-12 root is accepted without a media type (apidom-lsdoDeref). A root schema with$refstays the parse result'sresult.detectContent: false): external files referenced from OpenAPI/AsyncAPI documents often declare a root$schema, and those strategies expect generic ApiDOM. Regression tests for OpenAPI 3.1 and 3.2.Verification
$refin every schema-valued keyword, Link Description schemas, root$ref, every$dynamicRefunchanged (JSON Schema Test Suite fixtures)$ididentifiers in test fixtures)Known gaps
bundle()returns the document unchanged (no Compound Schema Document), as for OpenAPI 3.1.$dynamicRefis not dereferenced (left in place), as for OpenAPI 3.1.dereference('schema.json')/parse('schema.json')without a media type don't detect a standalone JSON Schema 2020-12 document and fall back to the ApiDOM strategy, as before; pass a 2020-12 media type or a parsed element.uriselector (here and in OpenAPI 3.1/3.2) misses a relative$idnested in another relative$id, and the$anchorselector also searches embedded$idresources; both are planned as one follow-up fix for all three selectors.apidom-ns-arazzo-1reassignsJSONSchemaElement.refractof the 2020-12 namespace, so with Arazzo loaded a schema using Hyper-Schemalinksfails to refract through the 2020-12 adapters (fixed separately infix/ns-arazzo-1-link-description). The new dereference strategy uses the namespace refractor and is not affected.🤖 Generated with Claude Code