fix(meta): state the subschema recursion statically as well as dynamically - #155
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #154.
The dialect body reaches nested subschemas through
$dynamicRef, whichvscode-json-languageservice5.7.2 does not resolve. The subschema then constrains nothing, so everyx-oold-*keyword insideproperties,$defs,itemsand 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$refjsonschemavscode-json-languageservice5.7.2vscode-json-languageservice6.0.0-next.3Over the real
meta/files,$schemaset to the OO-LD meta-schema, in 5.7.2:x-oold-range: 42insidepropertiesx-oold-range: 42at the root$idat the root$idThe
$dynamicAnchorwarning 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-schemalistedx-oold-rangeas a recursion site. It is not - its subschema form is{"type": "object"}and recurses nowhere.Verification
make validate:examples380 ok / 0 failed;examples/compliance72 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/150make checkexit 0, 80 rules, no drift