Replies: 1 comment
-
Thanks for the feedback. We're aware that this is a confusing topic, but it's helpful to hear what specifically you found confusing. We were working on it, but that's been put on hold while something more important has taken priority. I'm looking forward to getting back to that when I can. Things you can expect in the future are simplifying the behavior of In the meantime, people have found the official test suite to be a good source of examples that help them understand the feature. You might also find this StackOverflow answer to be a useful introduction that doesn't get too bogged down in the technical details. |
Beta Was this translation helpful? Give feedback.
-
I was trying to understand the dereferencing of
"$dynamicRef"
directly from the specification. I failed horribly.Luckily I have discovered this question which mentioned the slides here.
The slides are great! Now I believe I understand how it should work. Now I also believe that understanding this from the specification was completely hopeless (at least for me). The pros at ajv also seem confused (people have created issues, e.g. issue 1573, issue 1964; the current ajv version says this is valid).
Stuff that confused me:
"$dynamicAnchor"
in each upper scope and replace the URI with astaticBaseUri + "#" + dynamicAnchor
URI. Also, as seen in the test case, the target does not have to be a "resource" (in the sense of"$id"
-owner or root)."$ref"
)."$id"
to the intended target schema in the previously mentioned test case (add"$id"
here), then @hyperjump/json-schema suddenly finds that the instance ["foo", 42] is also valid. The slides address this too. We have to stop the search for"$dynamicAnchor"
at schemas owning an"$id"
."$dynamicAnchor"
at the roots and doesn't contain inner"$id"
s. The example is a good introduction but I couldn't extract from it how the dereferencing is supposed to work in general.I am not going to request a specification update or any other action (other people might understand it; I know it's work). Maybe the slides could be mentioned in a
cref
in the appendix for now? Maybe I should just be patient :).Thank you for the slides, the forum, the above mentioned forum question and its answer!
I do not expect an answer. If I have chosen the wrong channel for this kind of contribution, please tell me and I will try to delete it.
Beta Was this translation helpful? Give feedback.
All reactions