Baggz / Amanda

JSON Schema validator
https://github.com/Baggz/Amanda
MIT License
144 stars 36 forks source link

additionalProperties with 'false' value #56

Open andrzejpolis opened 11 years ago

andrzejpolis commented 11 years ago

This fragment from documentation is wrong:

/**
 * Schema
 */
var schema = {
  type: 'object',
  additionalProperties: 'false',
  properties: {
    name: {
      type: 'string'
    },
    surname: {
      type: 'string'
    }
  }
};

Code only supports boolean value for additionalProperties attribute. But the real problem is that at the end of additionalPropertiesAttribute function (amanda.js source file) should be some throw or "callback" attribute call with error info about illegal state. Right now this string value leads to correct end of validation and no "callback" call.