JoiError and ValidationError type clashing
cmdcarini opened this issue · 3 comments
cmdcarini commented
The fix introduced in #134 actually made our TS build pass. In versions before (and after) v3.0.7, our usage of the constructor ValidationError(message, details/req, original/res) fails as it isn't expecting parameters in the constructor (because one isn't defined by express-validation, but is in Joi).
Ex. of TS code that works in v3.0.7 but not in other versions
const error = new ValidationError('test', { body: [] }, {});
Any suggestions? For now we'll just stay on v3.0.7
papandreou commented
papandreou commented
2nd attempt: #157
The params for ValidationError
are slightly different from what you put above: It's new ValidationError({ body: [] }, {});
papandreou commented
Should be fixed in 4.0.1 now.