-
Notifications
You must be signed in to change notification settings - Fork 709
UnsupportedApiVersion error when route constraint prevents a match #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Technically, this has been the existing behavior for API versioning due to limitations in the routing system. Endpoint Routing addresses most of these limitations. I had things short-circuiting if a candidate is already invalid. This might exclude candidates that match the requested API version, but are already invalid (ex: due to an invalid route constraint) and ultimately produce an unexpected response. Since this wasn't the expected intent, I'll consider it a bug. I should have the fix out shortly. For future reference, here are the behavioral differences: Legacy Routing
Endpoint Routing
|
3.1.1 with the fix is now available. Thanks. |
It's working now! Thank you! |
This issue appears to have returned as a regression in version 4.2.0 |
I have a controller with an action that specifies a route constraint. Here is a snippet.
If I make a request with a valid GUID in the path (i.e.
PUT /api/v1/12345678-90ab-cdef-1234-567890abcdef
), everything works as expected. But if I use an invalid GUID in the path (e.g.PUT /api/v1/1234
), I get a 400 with the following body:I'm expecting a 404 because no route is supposed to match, according to the documentation.
I'm using ASP.NET Core 2.2 and API Versioning version 3.1.
The text was updated successfully, but these errors were encountered: