question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

notEmpty() not working

See original GitHub issue

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 ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
shanutthankachancommented, Dec 27, 2018

use, check('lastName').not().isEmpty().withMessage('The Last name is required')

1reaction
gustavohenkecommented, Oct 12, 2019

Hey @jaguardev, You would do it like this:

checkSchema({
	id: {
		isEmpty: {
			negated: true,
		}
	}
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

Hibernate validator @NotEmpty not working spring boot and ...
The @NotEmpty validation is not kicked off at all. Hibernate validation only works if the json has errors element in it as below...
Read more >
Difference Between @NotNull, @NotEmpty, and @NotBlank ...
In a nutshell, this means that a field (e.g. CharSequence, Collection, Map, or Array) constrained with @NotEmpty must be not null, and its...
Read more >
Built-in Validators — FluentValidation documentation
NotEmpty Validator¶. Ensures that the specified property is not null, an empty string or whitespace (or the default value for value types, e.g.,...
Read more >
Using Fluent Validation in ASP.NET Core - Powerful Validations
It's highly practical to show custom validation based on the property. It's quite simple with Fluent Validation. Go to the DeveloperValidator.cs ...
Read more >
Built-In, Nested, Custom Validators with FluentValidation
In most cases, you'd just use the NotEmpty() validator, unless you want to allow whitespace as a valid value, however, it's worth showing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found