Closed airrakeshkumarsharma closed 3 years ago
node
celebrate
My joi schema looks like this: `Joi.object().keys({ // Filters filters: Joi.array() .items({ key: Joi.string().required(), type: Joi.string(), value: [Joi.string().trim(), Joi.array(), Joi.boolean()], upperValue: [Joi.number(), Joi.string().isoDate().allow(null)], lowerValue: [Joi.number(), Joi.string().isoDate().allow(null)], operation: Joi.string() }) .default([]),
joi
// Sort sort: Joi.array() .items({ key: Joi.string().required(), order: Joi.number().required() }) .default([]),
// Pagination perPage: Joi.number().min(1).default(CONSTANTS.PAGINATION.PER_PAGE), pageNumber: Joi.number().min(1).default(1) });`
Here is an example value that is not working as expected:
?filters=[{"key":"userType","value":"STUDENT"}, {"type":"hash","key":"email","value":"ab8789789@gmail.com"}]
The issue I am having with celebrate is:
When I go to version 10 then celebrate is working fine and it is able to validate the params but when I just shift to v13 then it is not able to validate
node
version - 14.15.4celebrate
version - 13.0.4My
joi
schema looks like this: `Joi.object().keys({ // Filters filters: Joi.array() .items({ key: Joi.string().required(), type: Joi.string(), value: [Joi.string().trim(), Joi.array(), Joi.boolean()], upperValue: [Joi.number(), Joi.string().isoDate().allow(null)], lowerValue: [Joi.number(), Joi.string().isoDate().allow(null)], operation: Joi.string() }) .default([]),// Sort sort: Joi.array() .items({ key: Joi.string().required(), order: Joi.number().required() }) .default([]),
// Pagination perPage: Joi.number().min(1).default(CONSTANTS.PAGINATION.PER_PAGE), pageNumber: Joi.number().min(1).default(1) });`
Here is an example value that is not working as expected:
?filters=[{"key":"userType","value":"STUDENT"}, {"type":"hash","key":"email","value":"ab8789789@gmail.com"}]
The issue I am having with
celebrate
is:When I go to version 10 then celebrate is working fine and it is able to validate the params but when I just shift to v13 then it is not able to validate