Open flaksp opened 2 years ago
There are tests for initial resolution.
https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/main/tests/draft2020-12/dynamicRef.json#L259 https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/main/tests/draft2020-12/dynamicRef.json#L311
There should probably be a test for using a JSON Pointer in a dynamic reference. Using a JSON Pointer doesn't make sense for a dynamic reference, but it's not illegal. It would just behave like a normal reference. (FYI, weird edge cases like that are going away in the next release.)
Oh, sorry, I missed them. I will rename the issue to mention only the JSON Pointer case.
Any chance you're interested in a PR @flaksp?
Yeah. I'm learning how all these complicated things work and test cases will be very helpful for me 🙂
Currently, all tests cover only the case where
$dynamicRef
contains a plain name fragment, e.g.:I believe we need more test cases because the question "what will happen if
$dynamicRef
will contain something but plain name fragment" seems to be popular from people like me who try to investigate how dynamic scope works. And it's confusing that there are no official examples nor in the spec and in the tests.