You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
produces no warning message, which could lead a lot of newcomers confused, not understand an errorMessage property should be used instead.
The issue can be trached to these lines in schema.js:
if(typeofchain[method]!=='function'){console.warn(`express-validator: a validator with name ${method} does not exist`);return;}
As you can see, it is checking whether or not a method withMessage is available on the chain. This may technically be predictable behavior, as you can get withMessage working by doing this:
Had a bit of trouble coming up with a good title, so I'll just explain.
this:
results in the warning message
express-validator: a validator with name couchPotato does not exist
as intented. However, this:produces no warning message, which could lead a lot of newcomers confused, not understand an
errorMessage
property should be used instead.The issue can be trached to these lines in
schema.js
:As you can see, it is checking whether or not a method
withMessage
is available on the chain. This may technically be predictable behavior, as you can get withMessage working by doing this:but this can still lead to potential issues later if more non-validator methods are worked in.
I would be happy to submit a fix for this.
The text was updated successfully, but these errors were encountered: