Prevent Api from auto return bad request response without firing CustomExceptionFilterAttribute
Bebarsse opened this issue · comments
In case if a controller action with an invalid ModelState , the Api return by default a 400 Bad Request without firing the CustomExceptionFilterAttribute .
The behaviour of the api must be changed with adding services.Configure<ApiBehaviorOptions>(options => { options.SuppressModelStateInvalidFilter = true; }); on the startup class to allow
CustomExceptionFilterAttribute handling these exceptions.
Hi @Bebarsse - that is how it is currently configured - https://github.com/JasonGT/NorthwindTraders/blob/master/Northwind.WebUI/Startup.cs.