-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Good day!
Autovalidation does not work when I try use it with struct DTO in MVC controllers.
The reason is here:
https://github.com/SharpGrip/FluentValidation.AutoValidation/blob/master/FluentValidation.AutoValidation.Mvc/src/Filters/FluentValidationAutoValidationActionFilter.cs#L64
and here:
https://github.com/SharpGrip/FluentValidation.AutoValidation/blob/master/FluentValidation.AutoValidation.Shared/src/Extensions/TypeExtensions.cs#L21
For some reason some types are not considered as 'Custom types' and ignored in the filter.
I suggest reconsider this logic and eliminate this validation completely or at least exclude from check list structs.
Honestly, I don't fully understand the reason for this behavior.
If you disagree to eliminate or mitigate this validation I can suggest:
- customize this validation via options or specific interface injection,
- at least describe this behavior in documentation.