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
Local refs don't work in relatively referenced schema #90
Comments
When the `"id"` key is specified as a `"number"` in both attribute and property definitions, then specified as a `"string"` value in the payload, the matcher will raise and the test will pass.
@musaffa I've pushed up #89 to address a related Issue (#88). I've pushed up 4b60536 to include the test you shared as failing. I've changed the The test passes. Could you leave some comments on the diff to help us better understand the underlying issue? |
Let me clarify the test again. The above schema requires all the ids to be of type string. If any id in the payload is an integer then the payload will be incorrect according to this schema. In fact, we pass an incorrect payload (see Setting all the ids as string attribute in the payload defeats the purpose of this test. |
@musaffa I've pushed up 42d6c6e to #89 to change the two tests to ensure all
#89 adds tests that use both Could you add some details that that PR or any of the commits to help us better reproduce the issues you're experiencing? |
When the `"id"` key is specified as a `"number"` in both attribute and property definitions, then specified as a `"string"` value in the payload, the matcher will raise and the test will pass.
When the `"id"` key is specified as a `"number"` in both attribute and property definitions, then specified as a `"string"` value in the payload, the matcher will raise and the test will pass.
Closes [#88]. Closes [#90]. Add tests from Issue #90 When the `"id"` key is specified as a `"number"` in both attribute and property definitions, then specified as a `"string"` value in the payload, the matcher will raise and the test will pass. After rebasing off `master` after [`3b66b4d`][3b66b4d] was merged, [the tests that were once failing][tests] are now passing. [#88]: #88 [#90]: #90 [3b66b4d]: 3b66b4d [tests]: #89 (comment)
Here's a failing spec.
posts/index
schema refers topost
schema as its item. In the referenced schema (post), we are trying to use attribute definition (local to the post schema) from attribute property by"$ref": "#/definitions/attributes"
. In the attribute definition, "id" type has intentionally been set to "string". In our test json, we use an integer for that id attribute. It shouldn't match but it does.If I replace the atttribute definition with the inline definition(as in the commented out section), then the schema doesn't match and the test passes. This is the expected behaviour.
In a nutshell, inline definitions in a referenced schema work, but local ref definitions in that referenced schema don't work.
The text was updated successfully, but these errors were encountered: