diff --git a/lib/revalidator.js b/lib/revalidator.js index 58476b0..f17bdf3 100644 --- a/lib/revalidator.js +++ b/lib/revalidator.js @@ -114,6 +114,7 @@ additionalProperties: "must not exist" }; validate.messages['enum'] = "must be present in given enumerator"; + validate.messages['notEnum'] = "must not be present in given enumerator"; /** * @@ -295,6 +296,10 @@ if (schema['enum'] && schema['enum'].indexOf(value) === -1) { error('enum', property, value, schema, errors); } + + if (schema['notEnum'] && schema['notEnum'].indexOf(value) > -1 ) { + error('notEnum', property, value, schema, errors); + } // Dependencies (see 5.8) if (typeof schema.dependencies === 'string' &&