Endpoint Routing incompatible with API versioning
See original GitHub issueDescribe the bug
UrlHelpers cannot locate routes when controller route contains api version.
InvalidOperationException: No route matches the supplied values. Microsoft.AspNetCore.Mvc.CreatedAtActionResult.OnFormatting(ActionContext context)
Disabling Endpoint Router restores correct behaviour.
To Reproduce
Steps to reproduce the behaviour:
- Get attached reproduction: bug.zip
- Run the application
- Navigate to http://localhost:5002/Bar (SUCCESS)
- Navigate to http://localhost:5002/v1/Foo (FAIL)
- Toggle
EnableEndpointRouting
in startup (see.AddMvcCore(options => options.EnableEndpointRouting = true)
) - Navigate to http://localhost:5002/v1/Foo (SUCCESS)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Unsupported API version with versions within URI
The API controller has three different routes for test purposes. Notice that the controller itself has no [Route()] or [ApiVersion()] ...
Read more >API versioning extension with ASP.NET Core OData 8
NET Core, has the built-in API versioning functionality via route URL ... We need a routing matcher policy to select the best endpoint....
Read more >API versioning and changelog
This page covers backwards-incompatible, versioned API changes. For a list of all API updates, including non-versioned ones, see the changelog.
Read more >Your Guide to REST API Versioning in ASP.NET Core
Introducing Multiple Versions for a Single Endpoint. Let's say we want to work with two versions of our API, 1.0 and 2.0. We...
Read more >.NET Handbook | Api / Versioning
Implementing API versioning in code is highly dependent on the existing codebase - it can be as simple as adding a minor revision...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
API Versioning 3.1 has been released and includes support for Endpoint Routing.
@AdamWillden unless you are continuing to observe issues, I believe this issue can now be closed.
cc: @Eilon
Wow, that’s really kind of you. I’ll try this out once the wine wears off 🍷 … Maybe Friday 🙄 . I’ll close as you’ve obviously sorted this for me.