garycourt/JSV — Issue #31: Wrong validation of a nested array
Author: slopjong
Created: 2012-02-24 13:19:12+00:00
State: open

If you execute the following example, both JSONs are validated being correct but the schema specifies a nested non-empty array and thus the JSON should be validated as incorrect.

```javascript
var JSV = require('../lib/jsv').JSV;
var env = JSV.createEnvironment("json-schema-draft-03");

var schema =
{
"properties":{
"sensors":{
"required": false,
"type":"object",
"properties":{
"temp":{
"required": false,
"type":"array",
"items":{
"required": true,
"type":"array",
"items":{
"required": true,
"minItems": 2,
"maxItems": 2,
"type": "string"
}
}
}
}
}
}
}

var report;

report = env.validate( {"sensors": {"temp":[]}} , schema);
for(i=0; i