-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
Test failure due to update in JSON-Schema-Test-Suite #357
Comments
Merged
Yes that's fine. We're probably failing to handle some edge case. I'll take a look. Thanks for raising this! |
iainbeeston
added a commit
to iainbeeston/json-schema
that referenced
this issue
Sep 28, 2016
For a few weeks we've had a test from the json-schema common test suite failing on master. The test was checking that it was possible to validate a property named "$ref" (and that it wasn't reserved or interpreted as a json-reference). The problem was that whenever we had a property name that has special meaning in json-schema (ie. one that matches the keys of the Schema::Validator#attributes hash), we'd skip a level in the schema object while validating, which would cause errors. To fix the problem I've made sure we always descend one level at a time (see attributes/additionalproperties.rb line 17). Fixing this caused new tests to fail, in test/extends_nested_test.rb. It turns out that these tests were depending on the old incorrect behaviour. What's more, the same tests were using an incorrect form of the extends property. According to the json-schema spec, extends should take a json-schema, or an array of json-schemas. However, these tests were passing a string to extends. It seems that although this is incorrect, we had code in attributes/extends.rb which would automatically correct this incorrect syntax (ie. from {"extends": "foo.json"} to {"extends: {"$ref": "foo.json"}}). I've removed that workaround, as well as correcting the tests. Fixes voxpupuli#357
iainbeeston
added a commit
to iainbeeston/json-schema
that referenced
this issue
Sep 28, 2016
For a few weeks we've had a test from the json-schema common test suite failing on master. The test was checking that it was possible to validate a property named "$ref" (and that it wasn't reserved or interpreted as a json-reference). The problem was that whenever we had a property name that has special meaning in json-schema (ie. one that matches the keys of the Schema::Validator#attributes hash), we'd skip a level in the schema object while validating, which would cause errors. To fix the problem I've made sure we always descend one level at a time (see attributes/additionalproperties.rb line 17). Fixing this caused new tests to fail, in test/extends_nested_test.rb. It turns out that these tests were depending on the old incorrect behaviour. What's more, the same tests were using an incorrect form of the extends property. According to the json-schema spec, extends should take a json-schema, or an array of json-schemas. However, these tests were passing a string to extends. It seems that although this is incorrect, we had code in attributes/extends.rb which would automatically correct this incorrect syntax (ie. from {"extends": "foo.json"} to {"extends: {"$ref": "foo.json"}}). I've removed that workaround, as well as correcting the tests. Fixes voxpupuli#357
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This PR (which has been merged) introduced the failing tests.
json-schema-org/JSON-Schema-Test-Suite#125
The text was updated successfully, but these errors were encountered: