break validation chain on first error
See original GitHub issueI apologize in advanced if I missed this somewhere in the docs, but say I have the following code:
check('foo')
.exists().withMessage('some message')
.custom(...)
Is there a way that I can prevent custom
from running if the exists
check fails?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:8 (3 by maintainers)
Top Results From Across the Web
express-validator Break validator chain - node.js
The fix for this has finally landed in v3.0.0! req.getValidationResult().then( result => { var errors = result.useFirstErrorOnly().array(); // enjoy an ...
Read more >Validation Chain API - express-validator
A validation chain created through check() or similar functions. If running that chain would produce errors, then the validation chain will stop.
Read more >Validator Chains - Laminas Documentation
By setting $breakChainOnFailure to true , if the validator fails, it will short-circuit execution of the chain, preventing subsequent validators from executing.
Read more >Advanced usage - Vuelidate
WARNING. BREAKING CHANGE: Since Vuelidate@2.0.0-alpha.9 the mixin has been removed. Instead, you have to use useVuelidate in your component's setup .
Read more >Validation - Laravel - The PHP Framework For Web Artisans
Sometimes you may wish to stop running validation rules on an attribute after the first validation failure. To do so, assign the bail...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s not possible yet. #500 implements a basic version of it.
Hey all! This is out with v6.2.0! 🚢