You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This allows a `$ref` to look up a schema by `$id` and then apply a JSON
pointer to use a subschema.
The test suite example schema looks like this:
```json
{
"$id": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed",
"properties": {
"foo": {"$ref": "urn:uuid:deadbeef-1234-0000-0000-4321feebdaed#/$defs/bar"}
},
"$defs": {
"bar": {"type": "string"}
}
}
```
Previously, ids were looked up using a URI that included the fragment
(ie, json pointer). Now if the fragment is a valid json pointer, the
schema is looked up without the fragment and the pointer is applied to
whatever is found.
I tried to simplify things as much as I could, but it still ended up
quite complicated. A slightly separate path is still necessary for refs
that start with `#` because they don't have to be encoded as URIs and
aren't always [valid URIs][0].
Refs are sent to the ref resolver if they aren't found by id and aren't
local json pointers.
`parent_uri` is a little tricky and I'm not sure I got it totally right
in all scenarios, but it's passing all the tests.
Exposed by: json-schema-org/JSON-Schema-Test-Suite#578
[0]: b91115e
0 commit comments