Feature Request/Discussion: Adding ValidationSeverity property to ValidationFailure class.
See original GitHub issueThe idea would be to add an enum to the ValdationFailure class to allow the user to set severity of the error.
public enum Severity { Info, Warning, Error };
Example Use:
RuleFor( r => r.Property).NotNull().Length( 1, 50 ).Severity( Severity.Info);
You can currently do this with the custom state but its a bit wacky, and if you want to provide any additional information(like specifying if the rule is a business directive or not) it can get complicated. I would think the default behavior if severity is not set would be set to return Error.
I am very much willing to implement it and submit a pull request, but I wanted to get your opinion on the matter before going through with it?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:10 (7 by maintainers)
Top Results From Across the Web
typestack/class-validator: Decorator-based property ...
Decorator-based property validation for classes. ... The validate method returns an array of ValidationError objects. Each ValidationError is:.
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 won’t be until after we’re done with adding .NET core support (you can use the alpha prerelease for now if you want to try it- this is unsigned. Use the strongnamer nuget package if you want to add signing to it)
Any news when this merge will be released on NuGet (fluentvalidation-signed version)? 😃