express-validator: Chaining check causes duplicated errors
request.check('email', 'Email is not valid').notEmpty().notNull().isEmail();
With no “email” field set this will return 3 repeatitions of the same message. Shouldn’t the error message be unified on chained call like this?
Thank you
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 25 (7 by maintainers)
Commits related to this issue
- added check to skip duplicated messages on same parameter (#30) — committed to muka/express-validator by deleted user 11 years ago
- getValidationErrors(): return a result object instead of errors directly This new format is more powerful and flexible than its counterparts. There is no longer a boolean trap, and the errors can be ... — committed to express-validator/express-validator by gustavohenke 8 years ago
- getValidationErrors(): return a result object instead of errors directly This new format is more powerful and flexible than its counterparts. There is no longer a boolean trap, and the errors can be ... — committed to express-validator/express-validator by gustavohenke 8 years ago
Hi everyone! The fix for this has finally landed in v3.0.0!
Hi @TheHominid. I’m glad that you found something that works for you at the moment.
Anyway, with the introduction of #269, it’s easy to add opt-in support to new methods that fix issues like this. That’s my plan, so this issue can finally be closed.