We are developing web api using web api 2 and fluent validation. Everything is working fine.
However, we realize the rules we define in fluent validation is not getting respect by the swagger (Swashbuckle).
For example
Class Customer {
public string Name {get;set;}
}
If I define the name as required field in the fluent validator, the property is marked as optional in the api. I know we can make that work by using .net annotation attribute. But we don't want to separate the validation logic (some of the logic are not easy to do in .net annotation.
Any comment on that will be appreciated.