Blazored / FluentValidation

A library for using FluentValidation with Blazor
https://blazored.github.io/FluentValidation/
MIT License
577 stars 83 forks source link

Incorrect clientside validation #195

Open darrenjlewington opened 1 year ago

darrenjlewington commented 1 year ago

Dear Jeremy,

I've just upgraded from Fluentvalidation 5.x to 8.x, as we're now using Mvc 5.

We have a rule like RuleFor(x => x. abc).NotEmpty().When(x => x.def).WithMessage("ghi");

The above rule is causing clientside validation attributes to be generated, but not with the message "ghi", but with the property name "abc".

My understanding was that a when clause would not generate clientside validation, and this is what I would like.

When I comment out the rule, then no clientside validation is being generated. So I think that rules out any other Issues?

Can you provide any insight into this please, as I've run out of things to try.

Thank you and kind regards,

Darren

darrenjlewington commented 1 year ago

I should note that property abc is a string, and property def is a bool.

Kind regards,

Darren