-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
Document supported JSON Schema versions #121
Comments
In retrospect, I now realize that "JSON-Schema-Ref-Parser" was a poor name choice for this library. It doesn't actually support any version of JSON Schema, and it's not intended to. This library is an implementation of the JSON Reference and JSON Pointer specs, not the JSON Schema spec. The three specs are all very closely related to each other, and are very often used together, which causes people to think of all three as a single spec, but that's not actually the case. |
Hi @JamesMessinger, thanks for the quick answer! I wasn't aware that JSON Schema $Ref Parser handles JSON Reference and JSON Pointer exclusively and just assumed (because of the name) that it would handle JSON Schema specialties like The reason I was asking in the first place was because I'm using Json Schema $Ref Parser in combination with Typescript and the typings indicate that the library only supports JSON Schema 4 and 6. |
@JamesMessinger as a heads up, the next draft of JSON Schema (which we will have published soon... really... within a month... probably... I hope... it's been a long year 🤕 ) changes the behavior of Specifically, adjacent keywords are no longer ignored, so given the following (note that {
"type": "object",
"properties": {
"foo": {
"title": "Foo",
"maximum": 100,
"$ref": {"#/$defs/foo"}
}
},
"$defs": {
"foo": {
"type": "integer",
"minimum": 0
}
}
} the appropriate dereferenced version is: {
"type": "object",
"properties": {
"foo": {
"title": "Foo",
"maximum": 100,
"allOf": [
{
"type": "integer",
"minimum": 0
}
]
}
}
} If there had already been an I actually came here to file an issue specifically on this and then noticed that this issue is relevant. I can also file it separately if preferred. |
I dont think a dereference should be rewriting your Schemas with an allOf like that, but there are plans to get this library replaced with something a little more true to JSON Schema than this current implementation. I'll close this one down and you should get some information about the new libs through deprecation warnings if/when this happens. Thanks! |
It would be very helpful if you could document in the README or on the API website which versions of JSON Schema are supported. For example
draft-04
,draft-06
anddraft-07
.The text was updated successfully, but these errors were encountered: