New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
notEmpty() not working #476
Comments
I see that you closed this issues the same day you posted it, but I am now facing the same issue as you. It appears that "notEmpty()" is no longer provided by validator.js as a validator, but is there an alternative? I simply want to make sure that an input on a form is not empty. I realize this can be done with the "required" html attribute, but I want to know if there is a standard way to do it via express-validator, so I can keep all my validation in one place. |
Hi @Ethan-ks,
It was never a validator.js validator. Actually, it was an express-validator validator in the legacy API (in fact, it still is).
Yes, with the check API you can use I acknowledge this was way too popular in previous versions of express-validator, so I'm willing to bring it back. |
I think that |
Again, not a validator.js thing. The check API returns a Validation Chain, which in turn contains all of validator.js validators + a few other methods (these being documented there). Do you know of any way we could improve the docs to make these more prominent? |
Thanks @gustavohenke for the solution. I was facing a similar bug to @dhpradeep and I was able to fix it with the solution you provided. Thanks man |
use, |
Thanks @gustavohenke I faced this issue. Followed your solution and it worked. Big ups! |
using not().isEmpty() works for imperative style great
|
Hey @jaguardev, checkSchema({
id: {
isEmpty: {
negated: true,
}
}
}) |
Shipped in v6.3.0! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi , i'm using latest version of express-validator,
and there is nothing about notEmpty in readme.md .
when i use it shows this message
check('topic', 'this is not be empty').notEmpty(),
TypeError: check(...).notEmpty is not a function
so how can i use ?
The text was updated successfully, but these errors were encountered: