Closed GoogleCodeExporter closed 8 years ago
I made some improvements to check optional and additionalParameters issues:
if (schema.items) {
if(schema.items instanceof Array) {
for (var k = 0,l=value.length; k < l; k++) {
if(k < schema.items.length) {
errors2.concat(checkProp(value[k],schema.items[k],path,k));
}
else {
if(schema.additionalProperties !== undefined) {
if(schema.additionalProperties === false) {
addError("The item " + i + "[" + k + "] is not defined in the objTypeDef
and the objTypeDef does not allow additional properties");
}
else {
errors2.concat(checkProp(value[k],schema.additionalProperties,path,k));
}
}
}
}
if(value.length < schema.items.length) {
for (var k = value.length; k < schema.items.length; k++) {
errors2.concat(checkProp(undefined,schema.items[k],path,k));
}
}
}
else { ...
Original comment by bruno.gradua@gmail.com
on 4 Dec 2008 at 7:34
Original comment by kris...@gmail.com
on 16 Apr 2009 at 8:36
Original issue reported on code.google.com by
bruno.p.reis@gmail.com
on 4 Dec 2008 at 5:33