❔ Change default behaviour of .NET Web API Validation Errors
Hi does anyone know how I can override the default problem details/validation error response .net gives when things like Guid and DateTime's are in an incorrect format?
I have implemented my own validation error responses but can't seem to avoid these type of ones firing^
Mine look like this:
FYI: my validation logic is driven by FluentValidation, I'm not using attributes etc.
3 Replies
Custom Model Binding in ASP.NET Core
Learn how model binding allows controller actions to work directly with model types in ASP.NET Core.
Stack Overflow
ASP.NET Core customize the error when model binding fails
I try to apply back end validation whenever empty or invalid values are send to ASP.NET Core Web API endpoint, but I can't figure out how to handle model binding failure errors.
Getting this error
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.