There is a RFC about default response type for API's in case of error.
Abstract
This document defines a "problem detail" as a way to carry machine-
readable details of errors in a HTTP response to avoid the need to
define new error response formats for HTTP APIs.
There is a RFC about default response type for API's in case of error.
And Microsoft has a default implementation in ASP.NET Core, ProblemDetails
So instead return a custom object in BadRequest, it could return a ProblemDetails.
Why? Support best practices