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
What I think is happening here is that the repetition of the reference to root.schema.json is being resolved down to $refs in later references. However because those sub schemas (sub1.schema.json) include as $id that changes the base uri for resolution. The result is #/oneOf/0/allOf/0 is being resolved from sub2.schema.json and not from root.schema.json.
When passed into AJV this then results in.
MissingRefError: can't resolve reference #/oneOf/0/allOf/0 from id sub2.schema.json
Removing the $id from sub*.schema.json which prevents the base uri from being changed corrects the issue.
Sample
https://github.com/phawxby/json-ref-example/blob/main/src/example.ts
What I think is happening here is that the repetition of the reference to
root.schema.json
is being resolved down to$refs
in later references. However because those sub schemas (sub1.schema.json
) include as$id
that changes the base uri for resolution. The result is#/oneOf/0/allOf/0
is being resolved fromsub2.schema.json
and not fromroot.schema.json
.When passed into AJV this then results in.
Removing the
$id
fromsub*.schema.json
which prevents the base uri from being changed corrects the issue.Compiled output
The text was updated successfully, but these errors were encountered: