-
Notifications
You must be signed in to change notification settings - Fork 331
Cannot get the validation result with self-reference schema #13
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
Comments
A bit further: the validation only fails when the schema contains a self-reference. If I remove it: {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"tree": {
"$ref": "#/definitions/tree"
}
},
"required": [
"name","tree"
],
"definitions": {
"tree": {
"type": "object",
"properties": {
"value": {
"type": "string"
},
"branches": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"required": [
"value"
]
}
}
} The validator reports a correct message for the following node: {
"name": "xxx",
"tree": { }
} something like Message : $.tree.value: is missing but it is required |
More information can be found in #12 as the root cause is to support nested reference. |
@lmichel We have made a lot of changes regarding the reference. Could you please test it again? Thanks. |
I'm now a bit far from this issue, although still interested. I'll check this ASAP |
This issue has been resolved by @davidvisiedo in #180 |
Steve,
I'm trying to validate the following JSON node:
against this schema:
The node is not valid since $tree has no member named "value" (confirmed by http://www.jsonschemavalidator.net/)
My code is like this:
with both node and schema created by methods XXXFromClasspath of the class BaseJsonSchemaValidatorTest (I made those methods public for this purpose)
The output is
No error is detected!!
Did I do something wrong?
I tried to follow with a debugger. My understanding is that the error is detected but at some point one of the stacked validate() invocations generate a null message (I'm not sure at all!).
The text was updated successfully, but these errors were encountered: