Automatic model state validation short-circuits an API action when ModelState is invalid, returning a BadRequestObjectResult before the action can inspect the errors. section 6.2.3
Preserve [ApiController] features while disabling only this filter through ApiBehaviorOptions. The action can then inspect ModelState and choose a context-specific response. section 6.2.3
A practical customization sequence is:
- Inspect validation keys and return a tailored status, such as HTTP 501 for a PageSize error and HTTP 400 otherwise. section 6.2.3
