klarna/jesse — pull request #30 by sstrigler (2014-11-14 10:57:49+00:00)
Title: fix validating array with multiple types

When validating a schema like

{
"title" : "AgendaModify",
"type" : "array",
"required" : true,
"items" :{
"type": [
{
"type": "object",
"properties" : {
"phone" : {
"type": "string",
"pattern" : "^\+\d{10,15}$",
"required": true
}
},
"additionalProperties": false
},
{
"type": "object",
"properties" : {
"email" : {
"type": "string",
"pattern" : "^\S+@\S+\.\S+$",
"required": true
}
},
"additionalProperties": false
}
]
},
"additionalItems": false
}

jesse would just accept any types for items in array. This fixes that situation as results from validation are actually evaluated.