Case insensitivity in enum route binding #45590
Labels
Needs: Author Feedback
The author of this issue needs to respond in order for us to continue investigating this issue.
old-area-web-frameworks-do-not-use
*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Status: No Recent Activity
Is there an existing issue for this?
Describe the bug
I am trying to use enums as a route parameter in my .net 7 minimal api, with the flexibility to have case insensitivity in the parameter binding. I've done this in .NET 6 controller based APIs which worked with identical configuration (seen below), but the behavior doesn't match here.
I am avoiding trying to write a custom parameter binding as I wish to let Swagger auto-discover the enum parameter and hydrate the enum options properly. This API spec is shared outside of my team and the documentation built in with the enums is incredibly valuable.
Expected Behavior
POST /optiona
resolves the endpoint and returns the stringOptionA
Steps To Reproduce
dotnet new webapi -minimal
/optiona
and be shown an error/OptionA
and see"OptionA"
in the response body of the browser.Exceptions (if any)
No response
.NET Version
7.0.100
Anything else?
VS Code
The text was updated successfully, but these errors were encountered: