Closed santhosh-tekuri closed 1 year ago
My implementation errors on this:
evaluation generated an exception: {
"error": "EXCEPTION: uri \"https://test.json-schema.org/typical-dynamic-resolution/list\" conflicts with an existing schema resource",
"instanceLocation": "",
"keywordLocation": ""
}
Please use a unique identifier for each new resource.
@karenetheridge corrected $id
for uniqueness
Do we not already have a test for this? (Not at my computer right now) I seem to recall having something.
Just checking the current suite, we have
A $dynamicRef without a matching $dynamicAnchor in the same schema resource behaves like a normal $ref to $anchor
A $dynamicRef with a non-matching $dynamicAnchor in the same schema resource behaves like a normal $ref to $anchor
A $dynamicRef that initially resolves to a schema without a matching $dynamicAnchor behaves like a normal $ref to $anchor
These all declare $dynamicAnchor
, but they're out of the dynamic scope. I'd say that covers this case, though indirectly.
my impl https://github.com/santhosh-tekuri/boon passes all existing test cases, but it does not pass this test case.
below is the logic in my implementation validator.rs#L567-L574:
$dynamicAnchor
search for override in dynamic scopein step 1, it resolves to #/$defs/list/$defs/items
from root resource.
this initial target has $dynamicAnchor
property. so it searches for override in dynamic scope
since my impl does not pass this test, I wanted to confirm whether my understanding of spec is correct or not
Do we not already have a test for this?
That was my first reaction as well, but I checked and this does appear to be unique. This is the only test that uses a JSON Pointer in a dynamic reference.
This is the only test that uses a JSON Pointer in a dynamic reference. - @jdesrosiers
Should we refocus the test, then? If we're checking its functionality using a pointer, it should be focused on that, not that $dynamicRef
behaves like $ref
.
If we're checking its functionality using a pointer, it should be focused on that, not that
$dynamicRef
behaves like$ref
.
The functionality when using a pointer is that $dynamicRef
will behave like $ref
. I think the test is fine.
from https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-01#section-8.2.3.2:
please ensure that my understanding is correct and the test case is valid