diff --git a/lib/rules.js b/lib/rules.js index 06618ab..ad91571 100644 --- a/lib/rules.js +++ b/lib/rules.js @@ -259,7 +259,7 @@ var rules = { return x.length <= maxLength; }, expectedTypes: ['json', 'ref', 'string'], - defaultErrorMessage: function(x, maxLength) { return 'Value was '+(maxLength-x.length)+' character'+((maxLength-x.length !== 1) ? 's' : '')+' longer than the configured maximum length (' + maxLength + ')'; }, + defaultErrorMessage: function(x, maxLength) { return 'Value was '+(x.length-maxLength)+' character'+((x.length-maxLength !== 1) ? 's' : '')+' longer than the configured maximum length (' + maxLength + ')'; }, ignoreEmptyString: true, checkConfig: function(constraint) { if (typeof constraint !== 'number' && parseInt(constraint) !== constraint) {