-
-
Notifications
You must be signed in to change notification settings - Fork 217
Test dynamic behavior of "$recursiveRef" and "$recursiveAnchor" #298
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
Comments
I don't know if we want to do this for draft2019-09, given that the semantics of these keywords are changing soon, but we should also test what happens with this schema:
..and also the more interesting case where $recursiveRef is not "#", but the fragment is not empty (either a json pointer or a plain-name fragment serves equally well for this case) -- the fragment has to be resolved against the uri marking the position of the $recursiveAnchor, but there is no $id there, so how do we perform resolution? I suspect that with the way the spec is written now, this can only blow up, since we have no provision for "resolve one fragment against the other by concatenating them together" or anything like that. (@handrews I haven't read the new keyword proposals in great detail yet so I don't know if this case has been considered yet.. I just mention it without prejudice in the sense that this sort of scenario should be covered too.) |
@karenetheridge in the example schema you give, I believe the Regarding fragments, this is one reason why |
Sorry for being obtuse, but there's a few weird edge cases here and I want to completely understand. Does this mean that the final target for a $recursiveRef must be a resource root schema (which I believe means there MUST always be an $id keyword at the same location)? Or that the intermediary target (i.e. the location of the outermost $recursiveAnchor) must be a resource root schema? For example, is this legal?
This would mean that the $recursiveRef is always targeting a definition with a specific name within the referenced resource, but that referenced resource could change depending on which $recursiveAnchor is in effect at the source of the $recursiveRef. At the moment, I am throwing an exception on the combination of: $recursiveRef has a non-empty fragment, AND the canonical uri of the active $recursiveAnchor has a fragment (which would be any subschema that lacks an I tried for a little bit to concoct a test case with $recursiveRef having a non-empty path in the URI, and had to lie down from dizziness. :/ |
both. |
The presence of |
I guess I'll not worry too much about $recursiveAnchor and $recursiveRef in 2019-09 then :) I got the multi-step resolution working, although I had difficulty coming up with some good tests that went beyond just using "#" in $recursiveRef. |
Hi all. Am I right that there will be no tests for recursiveRef? And that it will be dynamicRef? Is there any timeline when it would stabilize? |
@karenetheridge wrote some tests for
|
I haven't read the next one yet - is it just renaming them? Or do they also extend "recursive" in some way? |
It's more than a rename. This change makes it so |
It looks like this is now tested quite thoroughly. @Julian @karenetheridge any reason not to go ahead and close this? |
Yup, indeed. Closing, thanks folks. |
Test where
"$recursiveRef"
targets a"$recursiveAnchor": true
schema and there is also an outer scope"$recursiveAnchor": true
to which the$recursiveRef
should actually resolve.Should probably have at least two cases:
links.json
, the schema for hyper-schema's Link Description Object, as the entry point).The text was updated successfully, but these errors were encountered: