molnarg / js-schema

Simple and intuitive schema validator
http://molnarg.github.com/js-schema/
MIT License
388 stars 45 forks source link

Adding error text for nothingSchema validation #47

Open Cyri-L opened 8 years ago

Cyri-L commented 8 years ago

before:

var NothingSchema = module.exports = Schema.patterns.NothingSchema = Schema.extend({
    errors: function (instance) {
        return false
    },

after:

var NothingSchema = module.exports = Schema.patterns.NothingSchema = Schema.extend({
    errors: function (instance) {
        if(instance != null)
            return "this key is not allowed in strict mode";
        return false
    },
YouriT commented 7 years ago

ping @molnarg