79357390

Date: 2025-01-15 07:45:29
Score: 1
Natty:
Report link

It does do that for you. I've experienced it myself. It accepts both the numeric and string value of the enums, validates them, and handles the 400 bad request return result and error message for you. The only thing I wish it did do is provide all the valid enum values in the error message so that a developer can see what needs to change.

See this answer to practically the same question from back in 2017 which still works today on .net 8 and 9:

Best practice for passing enum params in Web API

Reasons:
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Vector