Skip to content

fix(meta): state the subschema recursion statically as well as dynamically - #155

Merged
simontaurus merged 3 commits into
mainfrom
fix/meta-static-recursion
Aug 29, 2026
Merged

fix(meta): state the subschema recursion statically as well as dynamically#155
simontaurus merged 3 commits into
mainfrom
fix/meta-static-recursion

Conversation

@simontaurus

@simontaurus simontaurus commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #154.

The dialect body reaches nested subschemas through $dynamicRef, which vscode-json-languageservice 5.7.2 does not resolve. The subschema then constrains nothing, so every x-oold-* keyword inside properties, $defs, items and the rest went unchecked - silently, since the document still validates. Nested standard keyword errors are still reported, from the service's own built-in draft validation, which is what masks the gap.

Change

The body states the same recursion a second time, as a plain $ref: "#" at each subschema slot the 2020-12 applicator, core, unevaluated and content vocabularies define (19 entries). $dynamicAnchor: "meta" stays, so conformant validators and downstream dialects are unaffected.

Measured

Isolated on a meta-schema that never references 2020-12, one recursion slot, one custom keyword:

$dynamicRef static $ref
ajv 2020 caught caught
Python jsonschema caught caught
vscode-json-languageservice 5.7.2 missed caught
vscode-json-languageservice 6.0.0-next.3 caught caught

Over the real meta/ files, $schema set to the OO-LD meta-schema, in 5.7.2:

case before after
x-oold-range: 42 inside properties not caught caught
x-oold-range: 42 at the root caught caught
missing $id at the root caught caught
nested subschema without $id no false error no false error

The $dynamicAnchor warning banner remains in 5.7.2 and is gone in 6.0.0-next.3. Silencing it would mean dropping the anchor, which costs downstream dialects the dynamic extension point for a cosmetic gain, so it stays.

Also

#meta-schema listed x-oold-range as a recursion site. It is not - its subschema form is {"type": "object"} and recurses nowhere.

Verification

  • make validate: examples 380 ok / 0 failed; examples/compliance 72 ok / 0 failed across 54 targets (2 new fixtures: a nested malformed keyword is rejected, a nested subschema still needs no $id)
  • make validate-reference (ajv): 150/150
  • make check exit 0, 80 rules, no drift

…cRef

Editor tooling without the dynamic keywords resolves $dynamicRef "#meta"
against the standard meta-schema, so every subschema was checked as plain
2020-12 and the x-oold-* keywords went unvalidated wherever they are
actually written.

- drop $dynamicAnchor from the base and the UI meta-schema
- add one static $ref per subschema slot the 2020-12 vocabularies define
- two compliance fixtures: a nested malformed keyword is rejected, a
  nested subschema still needs no $id
@simontaurus simontaurus changed the title fix(meta): recurse into the dialect statically instead of via $dynamicRef fix(meta): state the subschema recursion statically as well as dynamically Aug 29, 2026
@simontaurus
simontaurus merged commit f86871b into main Aug 29, 2026
3 checks passed
@simontaurus
simontaurus deleted the fix/meta-static-recursion branch August 29, 2026 15:48
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 this pull request may close these issues.

$dynamicAnchor / $dynamicRef seems not to be supported by majors tools like VSCode, blocking OO-LD meta schema based validation

1 participant