Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change error message format when validation fails from Fluent Validation #52

Closed
MrDave1999 opened this issue Dec 14, 2023 · 0 comments · Fixed by #53
Closed

Change error message format when validation fails from Fluent Validation #52

MrDave1999 opened this issue Dec 14, 2023 · 0 comments · Fixed by #53
Labels
enhancement An improvement to the library

Comments

@MrDave1999
Copy link
Owner

MrDave1999 commented Dec 14, 2023

Currently the SRFluentValidationResultExtensions.AsErrors method will return an error message like this:

'Name' must not be empty.
'First Name' must not be empty.

It would be good to change it to a more specific format like this one:

'Name' property failed validation. Error was: 'Name' must not be empty.

The template would look like this in English:

'{0}' property failed validation. Error was: {1}

And in Spanish:

Propiedad '{0}' falló en la validación. El error fue: {1}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement to the library
Projects
None yet
1 participant