Skip to content
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

allOf and $ref not working? #86

Closed
carole-lavillonniere opened this issue Nov 5, 2013 · 2 comments
Closed

allOf and $ref not working? #86

carole-lavillonniere opened this issue Nov 5, 2013 · 2 comments

Comments

@carole-lavillonniere
Copy link

Hi,

This is my schema:
{
"type": "object",
"properties": {
"game": {
"allOf": [
{"$ref": "../gameSchema.json"}
]
}
}
}

Whatever is in gameSchema.json doesn't seem to be taken in consideration and the validation is not done. I am sure that the path is correct because it fails in case of a syntax error inside gameSchema.json.

I am using v2.1.3.

@apsoto
Copy link
Contributor

apsoto commented Nov 5, 2013

I'm not sure a relative path like that works. Maybe review how the path is resolved here:

https://github.com/hoxworth/json-schema/blob/master/lib/json-schema/attributes/ref.rb

@carole-lavillonniere
Copy link
Author

The relative path is resolved. An absolute path is not working neither. The referenced schema just doesn't seem to be in the schemas hash, at this line:
https://github.com/hoxworth/json-schema/blob/master/lib/json-schema/attributes/ref.rb#L40

Also, there seem to be a problem with error recording because when using fully_validate the returned array would be empty, but when using validate!, I would get:
The property '#/game' of type Hash did not match all of the required schemas in schema

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants