-
-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bundled schema and $id
#97
Comments
Hi @paulwib - Thanks for opening this issue. As you pointed out, I've said before that this library is an implementation of the JSON Reference specification and the JSON Pointer specification, not the JSON Schema specification. Thus, the id keyword isn't supported, because that's not part of JSON Reference or JSON Pointer. That said... the name of this library is (perhaps inappropriately) json-schema-ref-parser, so it's easy to see why many people have been confused by its lack of support for the JSON Schema spec. So, yeah, I will probably end up adding support for No promises on timeframe though. I have lots of other obligations competing for my time and attention, and this change is likely to be pretty complicated and require a lot of thought and thorough testing. |
Also related to #145. |
Let's leave #145 to handle this topic. |
It seems that when bundling a schema
$id
attributes aren't considered which makes the output incompatible with other JSON Schema tools, for example:a.json
:b.json
:Some code:
Outputs:
The issue is that in JSON Schema
b.properties.bar.$ref
is resolved against the nestedb.$id
givinghttps://schema.example.com/b.json#/b/definitions/bar
which doesn't actually exist.This breaks other tools, like trying to use the bundled schema in Ajv.
I saw the comment on #22 that the aims of this library do not include supporting JSON Schema and the
$id
keyword, but it's confusing as the first line of the README says: "Parse, Resolve, and Dereference JSON Schema $ref pointers" 😄 Latest JSON Schema has it's own definition of$ref
and no longer uses the expired JSON Reference spec 😮Any chance of an option to consider
$id
when bundling?The text was updated successfully, but these errors were encountered: