Skip to content

Check for duplicate endpoint names on startup #36353

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

Merged
merged 3 commits into from
Sep 15, 2021
Merged

Conversation

captainsafia
Copy link
Member

Fixes #35436

@ghost ghost added the area-runtime label Sep 9, 2021
@davidfowl davidfowl requested a review from javiercn September 10, 2021 11:51
@captainsafia captainsafia marked this pull request as ready for review September 10, 2021 16:20
@captainsafia
Copy link
Member Author

Does this count as a breaking change!? Should there be an AppContext switch to skip this check?

This is technically not a breaking change. The policy has always been that duplicate endpoint names are not allowed in an application. The subtlety is that in MVC, route names map to endpoint names and we already have logic that checks to see if duplicate route names exist. There's also pre-existing logic in MVC that checks for duplicate endpoint names and throws an IOE. That logic was being superseded in the route name check.

throw new InvalidOperationException(builder.ToString());

So, TLDR, we are throwing this exception in a new place but it's not a breaking change in the sense that it is not introducing a new assumption.

Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@captainsafia
Copy link
Member Author

/backport to release/6.0

@github-actions
Copy link
Contributor

Started backporting to release/6.0: https://github.com/dotnet/aspnetcore/actions/runs/1231642715

@captainsafia
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@captainsafia captainsafia merged commit 28a9fc2 into main Sep 15, 2021
@captainsafia captainsafia deleted the safia/dupe-endpoint branch September 15, 2021 16:36
@ghost ghost added this to the 7.0-preview1 milestone Sep 15, 2021
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix minimal APIs behavior with duplicate endpoint and route names
6 participants