Skip to content

Refactor Catch-All Router #281

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

Closed
commonsensesoftware opened this issue Apr 16, 2018 · 0 comments
Closed

Refactor Catch-All Router #281

commonsensesoftware opened this issue Apr 16, 2018 · 0 comments
Assignees
Milestone

Comments

@commonsensesoftware
Copy link
Collaborator

commonsensesoftware commented Apr 16, 2018

Overview

Prior to ASP.NET Core 2.0, the routing infrastructure could call IActionSelector multiple times. This led to a bug in API versioning in which the IActionSelector implementation made a final decision too early. The existing solution adds a catch-all route to the end of the pipeline which collects all candidates, API versions, and subsequently applies the final decision using the IApiVersionRoutePolicy.

While functional, this design has led to a number of unexpected complexities integrating other middleware.

Additional Considerations

The existing IApiVersionRoutePolicy should attempt to retain as much of the existing functionality as possible to ease the transition. Careful regression analysis must be done to ensure re-entrant action selection doesn't occur or that an accurate final decision is made without breaking existing behaviors.

Limitations

This feature was meant to fully remove the catch-all route, but the routing infrastructure in ASP.NET Core makes this impossible for the time being. The IActionSelector can still be called multiple times and will even be called multiple times for the same semantic route template where the only difference is route constraints.

At this time, the existing behaviors can be improved, but not completely supplanted. The changes to the design will, therefore, take a direction that will be ready to remove the catch-all router once routing improvements come to ASP.NET Core.

@commonsensesoftware commonsensesoftware self-assigned this Apr 16, 2018
@commonsensesoftware commonsensesoftware added this to the 3.0 milestone Apr 16, 2018
@commonsensesoftware commonsensesoftware changed the title [Feature] Remove Catch-All Router Remove Catch-All Router Apr 16, 2018
@commonsensesoftware commonsensesoftware changed the title Remove Catch-All Router Refactor Catch-All Router Jun 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant