StopOnFirstFailure dont interrupt on failed DependentRules
See original GitHub issueSystem Details
- FluentValidation version: 8.0.100
- Web Framework version: Asp.NET Core 2.1
Issue Description
I tried to chained multiple dependent rules into a complex validator, like this
RuleFor(...) .Cascade(CascadeMode.StopOnFirstFailure) .NotEmpty() .DependentRules(()=>...) .DependentRules(()=>...)
but when the first dependent rules fail the second is still executed, is it a way to interrupt next a failed dependent rules ?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
StopOnFirstFailure dont interrupt on failed DependentRules
Issue Description. I tried to chained multiple dependent rules into a complex validator, like this RuleFor(...) .Cascade(CascadeMode.
Read more >Stop Fluent Validation on first failure
Just check for null before running the rules that depend on them, using a When condition. this.CascadeMode = CascadeMode.StopOnFirstFailure ...
Read more >Setting the Cascade mode
StopOnFirstFailure option was used to provide control over the default cascade mode at rule-level, but its use was not intuitive. There was no...
Read more >Fluentvalidation Stop On First Error
DependentRules(() => { by using FluentValidation rules to define Swagger schema in ASP. ... Stop on first failure · Issue #1224 · FluentValidation....
Read more >Fluent validation child rules. Information required ...
Multiple Dependent Rules FluentValidation. StopOnFirstFailure because it always checks for first validation failure and stop validating others.
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
Yes that’s something that we can look at adding in the future.
Thanks for the solution, i find an other way, but i keep that in mind. I think that will be a good new feature to chain DependentRules, if it’s possible. What do you think ?