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.

Feature Request/Discussion: Adding ValidationSeverity property to ValidationFailure class.

See original GitHub issue

The 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:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
JeremySkinnercommented, May 31, 2016

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)

0reactions
kwlincommented, May 31, 2016

Any news when this merge will be released on NuGet (fluentvalidation-signed version)? 😃

Read more comments on GitHub >

github_iconTop 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 >

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