From 7ce9f140a2b54e429f866718b05472d89b03e120 Mon Sep 17 00:00:00 2001 From: Mickael Burguet Date: Tue, 17 Jan 2017 10:56:02 -0500 Subject: [PATCH] Fix bug where validation is failing when type=number and value=null --- js/ParamValidation.js.map | 2 +- js/RequestValidator.js | 15 +++++++----- js/RequestValidator.js.map | 2 +- js/index.js | 4 ++-- js/index.js.map | 2 +- tests/unit/RequestValidator.ts | 42 ++++++++++++++++++++++++++++++++++ ts/RequestValidator.ts | 13 +++++++---- 7 files changed, 64 insertions(+), 16 deletions(-) diff --git a/js/ParamValidation.js.map b/js/ParamValidation.js.map index 641c04d..71fdea9 100644 --- a/js/ParamValidation.js.map +++ b/js/ParamValidation.js.map @@ -1 +1 @@ -{"version":3,"file":"ParamValidation.js","sourceRoot":"","sources":["../ts/ParamValidation.ts"],"names":[],"mappings":";AAAA;IAAA;QAEW,aAAQ,GAAY,KAAK,CAAC;QAC1B,QAAG,GAAW,CAAC,CAAC;QAChB,QAAG,GAAW,IAAI,CAAC;QACnB,WAAM,GAAW,IAAI,CAAC;QACtB,cAAS,GAAW,IAAI,CAAC;QACzB,WAAM,GAAU,IAAI,CAAC;QACrB,UAAK,GAAW,IAAI,CAAC;QAErB,aAAQ,GAAQ,KAAK,CAAC;IACjC,CAAC;IAAD,sBAAC;AAAD,CAAC,AAXD,IAWC;AAXY,uBAAe,kBAW3B,CAAA"} \ No newline at end of file +{"version":3,"file":"ParamValidation.js","sourceRoot":"","sources":["../ts/ParamValidation.ts"],"names":[],"mappings":";AAAA;IAAA;QAEW,aAAQ,GAAY,KAAK,CAAC;QAC1B,QAAG,GAAW,CAAC,CAAC;QAChB,QAAG,GAAW,IAAI,CAAC;QACnB,WAAM,GAAW,IAAI,CAAC;QACtB,cAAS,GAAW,IAAI,CAAC;QACzB,WAAM,GAAU,IAAI,CAAC;QACrB,UAAK,GAAW,IAAI,CAAC;QAErB,aAAQ,GAAQ,KAAK,CAAC;IACjC,CAAC;IAAD,sBAAC;AAAD,CAAC,AAXD,IAWC;AAXY,0CAAe"} \ No newline at end of file diff --git a/js/RequestValidator.js b/js/RequestValidator.js index 4ab3383..04b7397 100644 --- a/js/RequestValidator.js +++ b/js/RequestValidator.js @@ -1,5 +1,5 @@ "use strict"; -var ParamValidation_1 = require('./ParamValidation'); +var ParamValidation_1 = require("./ParamValidation"); var supportedTypes = ['string', 'number', 'boolean', 'numeric', 'date', 'array', 'object']; var supportedArrayTypes = ['string', 'number', 'boolean', 'numeric']; var RequestValidator = (function () { @@ -108,7 +108,7 @@ var RequestValidator = (function () { } delete validation.disallowExtraFields; } - var _loop_1 = function(key) { + var _loop_1 = function (key) { var paramValidation = RequestValidator.buildValidationParam(validation[key]); if (paramValidation) { var type = input ? typeof input[key] : undefined; @@ -132,7 +132,8 @@ var RequestValidator = (function () { for (var _i = 0, _a = this.getPrioritizedValidationKeys(validation); _i < _a.length; _i++) { var key = _a[_i]; var state_1 = _loop_1(key); - if (state_1 === "break") break; + if (state_1 === "break") + break; } return errorMessages; } @@ -158,8 +159,10 @@ var RequestValidator = (function () { if (RequestValidator.checkLength(input[key], paramValidation.length) !== true) { errorMessages.push(this.getErrorMessage(key, 'length', "Param " + key + " must have a length of " + paramValidation.length)); } - if (RequestValidator.checkMin(input[key], paramValidation.min) !== true) { - errorMessages.push(this.getErrorMessage(key, 'min', "Param " + key + " must have a minimum length of " + paramValidation.min)); + if (paramValidation.min !== 0 && input[key] !== null) { + if (RequestValidator.checkMin(input[key], paramValidation.min) !== true) { + errorMessages.push(this.getErrorMessage(key, 'min', "Param " + key + " must have a minimum length of " + paramValidation.min)); + } } if (RequestValidator.checkMax(input[key], paramValidation.max) !== true) { errorMessages.push(this.getErrorMessage(key, 'max', "Param " + key + " must have a maximum length of " + paramValidation.max)); @@ -203,7 +206,7 @@ var RequestValidator = (function () { if (inputType === 'undefined') { return true; } - else if (typeValidation.type === 'numeric') { + else if (typeValidation.type === 'numeric' || typeValidation.type === 'number') { var isNumeric = !isNaN(typeValidation.value); if (isNumeric === true) { typeValidation.value = parseInt(typeValidation.value, 10); diff --git a/js/RequestValidator.js.map b/js/RequestValidator.js.map index d42e458..7713871 100644 --- a/js/RequestValidator.js.map +++ b/js/RequestValidator.js.map @@ -1 +1 @@ -{"version":3,"file":"RequestValidator.js","sourceRoot":"","sources":["../ts/RequestValidator.ts"],"names":[],"mappings":";AAAA,gCAA8B,mBAAmB,CAAC,CAAA;AAElD,IAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC7F,IAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAcvE;IAKI,0BAAY,YAAyB;QAAzB,4BAAyB,GAAzB,oBAAyB;QAH7B,qBAAgB,GAAY,IAAI,CAAC;QAIrC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACrC,CAAC;IAEM,kDAAuB,GAA9B;QACI,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;IAClC,CAAC;IAES,0CAAe,GAAzB,UAA0B,KAAa,EAAE,SAAiB,EAAE,cAAsB;QAC9E,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YAC9G,MAAM,CAAC;gBACH,OAAO,EAAE,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC;gBACnD,UAAU,EAAE,SAAS;gBACrB,QAAQ,EAAE,IAAI;aACjB,CAAC;QACN,CAAC;QACD,MAAM,CAAC;YACH,OAAO,EAAE,cAAc;YACvB,UAAU,EAAE,SAAS;YACrB,QAAQ,EAAE,KAAK;SAClB,CAAC;IACN,CAAC;IAEM,mCAAQ,GAAf,UAAgB,GAAQ,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,CAAC,MAAM,IAAI,GAAG,CAAC;QAC/B,CAAC;QACD,MAAM,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC;YACnB,KAAK,WAAW;gBACZ,MAAM,CAAC,IAAI,CAAC;YAChB,KAAK,QAAQ;gBACT,MAAM,CAAC,KAAK,IAAI,GAAG,CAAC;YACxB,KAAK,QAAQ;gBACT,MAAM,CAAC,KAAK,CAAC,MAAM,IAAI,GAAG,CAAC;YAC/B;gBACI,MAAM,CAAC,IAAI,CAAC;QACpB,CAAC;IACL,CAAC;IAEc,4BAAW,GAA1B,UAA2B,KAAU,EAAE,MAAa;QAChD,EAAE,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC;YACxD,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC;QACD,EAAE,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC;YACzB,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;gBACvC,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;oBAC/B,MAAM,CAAC,KAAK,CAAC;gBACjB,CAAC;YACL,CAAC;YACD,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IACL,uBAAC;AAAD,CAAC,AAhZD,IAgZC;AAhZY,4CAAgB"} \ No newline at end of file diff --git a/js/index.js b/js/index.js index f5ed87e..9e1e743 100644 --- a/js/index.js +++ b/js/index.js @@ -2,6 +2,6 @@ function __export(m) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } -__export(require('./RequestValidator')); -__export(require('./ParamValidation')); +__export(require("./RequestValidator")); +__export(require("./ParamValidation")); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/js/index.js.map b/js/index.js.map index dbee31f..c868bab 100644 --- a/js/index.js.map +++ b/js/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":";;;;AAAA,iBAAc,oBAAoB,CAAC,EAAA;AACnC,iBAAc,mBAAmB,CAAC,EAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":";;;;AAAA,wCAAmC;AACnC,uCAAkC"} \ No newline at end of file diff --git a/tests/unit/RequestValidator.ts b/tests/unit/RequestValidator.ts index bb2bb30..a7536ba 100644 --- a/tests/unit/RequestValidator.ts +++ b/tests/unit/RequestValidator.ts @@ -190,6 +190,48 @@ describe('RequestValidator', () => { }); }); + it('RequestValidator::validate() number', () => { + expected = undefined; + validator.validate( + { + route: { + validation: { + query: { + id: {type: 'number', required: false} + } + } + }, query: {} + }, + null, test + ); + + expected = undefined; + const req: any = { + route: { + validation: { + body: { + id: {type: 'number', required: false, min: 0} + } + } + }, params: { + id: null + } + }; + validator.validate( + { + route: { + validation: { + body: { + id: {type: 'number', required: false, min: 0} + } + } + }, params: { + id: null + } + }, null, test + ); + }); + it('RequestValidator::validate() min', () => { expected = 'Query: Param id must have a minimum length of 2'; validator.validate( diff --git a/ts/RequestValidator.ts b/ts/RequestValidator.ts index 0dfd98a..535bee3 100644 --- a/ts/RequestValidator.ts +++ b/ts/RequestValidator.ts @@ -234,10 +234,13 @@ export class RequestValidator { } // Check min - if (RequestValidator.checkMin(input[key], paramValidation.min) !== true) { - errorMessages.push( - this.getErrorMessage(key, 'min', `Param ${key} must have a minimum length of ${paramValidation.min}`) - ); + // Pass if min=0 and value==null + if (paramValidation.min !== 0 && input[key] !== null) { + if (RequestValidator.checkMin(input[key], paramValidation.min) !== true) { + errorMessages.push( + this.getErrorMessage(key, 'min', `Param ${key} must have a minimum length of ${paramValidation.min}`) + ); + } } // Check max @@ -302,7 +305,7 @@ export class RequestValidator { if (inputType === 'undefined') { return true; - } else if (typeValidation.type === 'numeric') { + } else if (typeValidation.type === 'numeric' || typeValidation.type === 'number') { const isNumeric = !isNaN(typeValidation.value); if (isNumeric === true) { typeValidation.value = parseInt(typeValidation.value, 10);