-
-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review removed cref regarding $anchor's affect on dynamic scope resolution #1056
Comments
As far as I can tell, the only way
Problem 1 might occur if, for example, the implementation happens (as in my case) to use the same cache for storing (sub)schemas against URIs for Problem 2 might occur if there is a naming conflict within the same resource which - as in my implementation - might cause an
|
It's because if you |
I don't see how that behavior is what is defined in the spec. First, it does initial resolution (which has not effect in this example), then it checks dynamic scope. If dynamic scope is found, it will resolve there. If there is no dynamic scope, then it behaves like a Maybe there was another algorithm you intended? |
So when you
The key thing here is that you only get the extra, non-RFC 3986 behavior if the initial anchor was created by |
@handrews, now I see where you're coming from. To express the problem as code, you expect anchor information to be collected like this, // "$dynamicAnchor": "aaa"
anchors["aaa"] = { pointer: "/$defs/foo", dynamic: true };
// "$anchor": "aaa"
anchors["aaa"] = { pointer: "/$defs/bar", dynamic: false }; That could definitely result in the presence of an The way I (and it seems everyone else) interpreted it is more like this, // "$dynamicAnchor": "aaa"
dynamicAnchors["aaa"] = "https://example.com/my-schema#/$defs/foo";
anchors["aaa"] = "/$defs/foo";
// "$anchor": "aaa"
anchors["aaa"] = "/$defs/bar"; A I originally said,
Now I see how |
Reading this again, so much of the "bookending requirement" debate suddenly makes sense. It seems that the difference in opinion comes down to whether you think that If they interact, then, yes, you need bookending. Having Conversely, if they're isolated referencing mechanisms, then Not looking at what the spec actually says, I tend to prefer having isolated referencing mechanisms. I think it's simpler to understand and to implement. That said, there was probably a reason to have |
For the stable release, we're separating the two referencing mechanisms completely. |
We removed this cref regarding
$dynamicRef
/$dynamicAnchor
from draft 2020-12. It appears to be wrong, but we haven't had enough eyes on it to be 100% sure and we don't want it to get lost if it turns out that it does say something important. This issue is to remind us to come back to this after a few more people have implemented$dynamicRef
/$dynamicAnchor
and/or feel ready to contribute their thoughts.I see no way that an
$anchor
can affect dynamic scope resolution and even if it could, it's not clear how bookending solves that problem.Source: #1041 (comment)
The text was updated successfully, but these errors were encountered: