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
In JSON Schema Draft 4, it refers to the JSON Reference draft, which says (emphasis mine):
The "$ref" string value contains a URI [RFC3986], which identifies
the location of the JSON value being referenced. It is an error
condition if the string value does not conform to URI syntax rules. Any members other than "$ref" in a JSON Reference object SHALL be
ignored.
An object schema with a "$ref" property MUST be interpreted as a "$ref" reference. The value of the "$ref" property MUST be a URI Reference. Resolved against the current URI base, it identifies the URI of a schema to use. All other properties in a "$ref" object MUST be ignored.
However, in the JSON Schema test suite there is a test validating this very scenario.
How are these definitions reconciled? Using Visual Studio's validator, the schema is considered invalid because it ignores the "definitions" property, so the "$ref" doesn't resolve. Other validators seem to accept it as a valid schema. Which is the correct behavior?
The text was updated successfully, but these errors were encountered:
@jimmylewis thanks! I agree with your (and Visual Studio's) behavior, so this looks like a bug in the test suite. Could you please file it on that repository so the maintainer there sees it? This repository is for issues and enhancements of the specification itself.
@jimmylewis so it is! I've been so focused on getting draft-07 out the door that I haven't been paying much attention to the other repos. I'll try to get this fixed as soon as I have a moment. It's not good to have conforming implementations failing the suite.
Is the following JSON schema valid?
In JSON Schema Draft 4, it refers to the JSON Reference draft, which says (emphasis mine):
Similarly, in the latest JSON Schema draft, it says:
However, in the JSON Schema test suite there is a test validating this very scenario.
How are these definitions reconciled? Using Visual Studio's validator, the schema is considered invalid because it ignores the "definitions" property, so the "$ref" doesn't resolve. Other validators seem to accept it as a valid schema. Which is the correct behavior?
The text was updated successfully, but these errors were encountered: