Summary
$dynamicRef is currently not supported in vscode-json-languageservice. This issue tracks incremental progress toward supporting it, starting with a failing test that documents the expected behavior.
This leads to valid Draft 2020-12 schemas being rejected during validation.
Current Behavior
Schemas using $dynamicRef produce the warning:
"The schema uses meta-schema features ($dynamicRef) that are not yet supported by the validator."
Validation does not proceed correctly.
Expected Behavior
For same-schema $dynamicRef (i.e., referencing a $dynamicAnchor within the same schema and without dynamic scope extension), validation should proceed without reporting an unsupported feature.
Minimal Repro
Schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$dynamicAnchor": "node",
"type": "object",
"properties": {
"child": {
"$dynamicRef": "#node"
}
}
}
Data:
Root Cause
In jsonSchemaService.ts, $dynamicRef is detected and added to usesUnsupportedFeatures with no attempt to resolve it:
if (next.$dynamicRef) {
usesUnsupportedFeatures.add('$dynamicRef');
}
Additional Context
I added a failing test demonstrating this behavior — 58 existing tests pass, 1 new test fails due to $dynamicRef being treated as unsupported.
Impact
This affects real-world usage of Draft 2020-12 schemas. Tools using modern JSON Schema features (e.g., MCP integrations) fail validation entirely due to $dynamicRef being unsupported.
Related Issues
Next Steps
I have a failing test ready and have been exploring approaches for resolution. Happy to open a PR and discuss the right direction with maintainers — wanted to check in here first before proceeding.
Summary
$dynamicRefis currently not supported invscode-json-languageservice. This issue tracks incremental progress toward supporting it, starting with a failing test that documents the expected behavior.This leads to valid Draft 2020-12 schemas being rejected during validation.
Current Behavior
Schemas using
$dynamicRefproduce the warning:Validation does not proceed correctly.
Expected Behavior
For same-schema
$dynamicRef(i.e., referencing a$dynamicAnchorwithin the same schema and without dynamic scope extension), validation should proceed without reporting an unsupported feature.Minimal Repro
Schema:
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$dynamicAnchor": "node", "type": "object", "properties": { "child": { "$dynamicRef": "#node" } } }Data:
{ "child": {} }Root Cause
In
jsonSchemaService.ts,$dynamicRefis detected and added tousesUnsupportedFeatureswith no attempt to resolve it:Additional Context
I added a failing test demonstrating this behavior — 58 existing tests pass, 1 new test fails due to
$dynamicRefbeing treated as unsupported.Impact
This affects real-world usage of Draft 2020-12 schemas. Tools using modern JSON Schema features (e.g., MCP integrations) fail validation entirely due to
$dynamicRefbeing unsupported.Related Issues
Next Steps
I have a failing test ready and have been exploring approaches for resolution. Happy to open a PR and discuss the right direction with maintainers — wanted to check in here first before proceeding.