Permalink
Browse files

Better error reporting for the ‘additionalProperties’ attribute

  • Loading branch information...
1 parent 36880a5 commit dd7ed49d597318b3b70ea48ca37b9eb44cd19869 @Baggz committed Mar 15, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/engines/json/attributes/additionalProperties.js
@@ -32,8 +32,16 @@ var additionalPropertiesAttribute = function additionalProperties(property, prop
* }
*/
if (attributeValue === false) {
- this.addError();
+
+ forbiddenProperties.forEach(function(forbiddenProperty) {
+ this.addError({
+ property: this.joinPath(property, forbiddenProperty),
+ propertyValue: propertyValue[forbiddenProperty]
+ });
+ }, this);
+
return callback();
+
}
/**

0 comments on commit dd7ed49

Please sign in to comment.