Description
https://json-schema.org/draft/2020-12/json-schema-core.html#dynamic-ref
If the initially resolved starting point URI includes a fragment that was created by the "$dynamicAnchor" keyword, the initial URI MUST be replaced by the URI (including the fragment) for the outermost schema resource in the dynamic scope that defines an identically named fragment with "$dynamicAnchor".
Otherwise, its behavior is identical to "$ref", and no runtime resolution is needed.
{
"$dynamicRef": "#foo",
"$defs": {
"a": {
"$dynamicAnchor": "foo"
}
}
}
In this example, the initially resolved starting point URI of $dynamicRef
includes a fragment that was created by the $dynamicAnchor
, but when we try to find "the outermost schema resource in the dynamic scope that defines an identically named fragment with $dynamicAnchor
", we are not able to find anything.
What should an implementation do in this situation? Should behavior be identical to $ref
, or maybe it's undefined behavior, and implementation could raise an error?