-
Notifications
You must be signed in to change notification settings - Fork 24
Return full list of validation errors #47
Comments
Hi! {
"properties": {
"title": { "type": "string", "minLength": 3 },
"foo" : { "type": "string", "pattern": "^[A-Z].*" }
}
} and passing {"title": "a", "foo": "a" } to the [ {
"schemaPath" : "#/properties/foo",
"errors" : { },
"msgs" : [ "a does not match pattern ^[A-Z].*" ],
"value" : "a",
"instancePath" : "/foo"
}, {
"schemaPath" : "#/properties/title",
"errors" : { },
"msgs" : [ "a violates min length of 3" ],
"value" : "a",
"instancePath" : "/title"
} ] Is this what you mean? If not, can you post an example and your expected outcome? |
Yes, that's exactly what i mean I've mistaken, it works:
There's is some bug in my code.. |
Ah, no, i reproduced the problem:
It fails when i try to convert JsError to JsObject with JsError.toJson method. Where is "job" property? |
|
Yes, it works! |
Hi!
It's not a bug but i would like to have full stack of errors when validate json over schema. Play's json reads works like that, it tries to read every property in a object and then it result in a success object or array of failed properties. Currently your library returns first failed property, doesn't it?
The text was updated successfully, but these errors were encountered: