From 39339d6ec7a2265230e4b5969686e7e0b0feed5e Mon Sep 17 00:00:00 2001 From: Quan Tang Date: Fri, 28 Jul 2023 09:27:23 +1200 Subject: [PATCH 1/2] NOJIRA: Fix logging information missing --- lib/middleware/request-validator.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/middleware/request-validator.js b/lib/middleware/request-validator.js index 8b88886..2f1adac 100644 --- a/lib/middleware/request-validator.js +++ b/lib/middleware/request-validator.js @@ -7,7 +7,7 @@ module.exports = ({ logger = console, schema, warnOnRequestValidationError }) => if (errors.length) { if (warnOnRequestValidationError) { - logger.warn('[VALIDATION WARNING] Invalid url path parameters', JSON.stringify(errors)) + logger.warn(`[VALIDATION WARNING] Invalid url path parameters: ${JSON.stringify(errors)}`) } else { throw new InvalidRequestError('Invalid url path parameters', errors) } @@ -17,7 +17,7 @@ module.exports = ({ logger = console, schema, warnOnRequestValidationError }) => let errors = schema.query.match(req.query) if (errors.length) { if (warnOnRequestValidationError) { - logger.warn('[VALIDATION WARNING] Invalid url query parameters', JSON.stringify(errors)) + logger.warn(`[VALIDATION WARNING] Invalid url query parameters: ${JSON.stringify(errors)}`) } else { throw new InvalidRequestError('Invalid url query parameters', errors) } @@ -27,7 +27,7 @@ module.exports = ({ logger = console, schema, warnOnRequestValidationError }) => let errors = schema.body.match(req.body) if (errors.length) { if (warnOnRequestValidationError) { - logger.warn('[VALIDATION WARNING] Invalid payload', JSON.stringify(errors)) + logger.warn(`[VALIDATION WARNING] Invalid payload: ${JSON.stringify(errors)}`) } else { throw new InvalidRequestError('Invalid payload', errors) } From 0e9d21e2cf6d9d235fee1e2251af5b70bf5a767a Mon Sep 17 00:00:00 2001 From: Quan Tang Date: Fri, 28 Jul 2023 09:49:48 +1200 Subject: [PATCH 2/2] NOJIRA: Bump the version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 96afb3d..f8a3012 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@luxuryescapes/router", - "version": "2.5.25", + "version": "2.5.26", "description": "Wrapper around express router that provides validation and documentation out of the box", "main": "index.js", "types": "index.d.ts",