json-schema
json-schema copied to clipboard
property name lost in validation message
If I have allowAdditionalProperties: false, I always have validation message with empty property name
{
"property": "",
"message": "stringThe property categoryName is not defined in the schema and the schema does not allow additional properties"
}
Something is wrong with a "path" in validate.js line 122, I fixed it by
var actualPath = path ? path + "." + i : i;
errors.push({property:actualPath,message:(typeof value) + " property " ...
and it looks nice after, and also works for nested properties
{
"property": "categoryName",
"message": "string property categoryName is not defined in the schema and the schema does not allow additional properties"
}
Not sure if the fix is correct, but could you pls take a look?