ModelState errors are not returned when action contains a ProducesAttribute, but instead produces a 406. #24406
Labels
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
✔️ Resolution: Answered
Resolved because the question asked by the original author has been answered.
Status: Resolved
Milestone
Describe the bug
When a controller or action contains a
ProducesAttribute("text/plain")
and an validation error occurs for the model, a 406 is returned instead of a 400.Might be related to, but I don't think it's a duplicate of: #16889
To Reproduce
https://github.com/JoasE/406
Execute action:
Response: 406
Further technical details
dotnet --info
VS 16.6.0
The text was updated successfully, but these errors were encountered: