Skip to content
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

Expose RoutePatternFactory.Combine #42593

Closed
davidfowl opened this issue Jul 6, 2022 · 4 comments · Fixed by #42557
Closed

Expose RoutePatternFactory.Combine #42593

davidfowl opened this issue Jul 6, 2022 · 4 comments · Fixed by #42557
Assignees
Labels
api-approved API was approved in API review, it can be implemented area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone

Comments

@davidfowl
Copy link
Member

Background and Motivation

Custom EndpointDataSource implementations need the ability to combine route patterns with the group prefix for custom route grouping semantics.

Proposed API

namespace Microsoft.AspNetCore.Routing.Patterns;

public static class RoutePatternFactory
{
+    public static RoutePattern Combine(RoutePattern? left, RoutePattern right);
}

Usage Examples

var prefixPattern = RoutePatternFactory.Parse("/api");
var pattern = RoutePatternFactory.Parse("/products/{id}");
var combinedPattern = RoutePatternFactory.Combine(prefixPattern, pattern);

Risks

None

@davidfowl davidfowl added api-suggestion Early API idea and discussion, it is NOT ready for implementation api-ready-for-review API is ready for formal API review - https://github.com/dotnet/apireviews and removed api-suggestion Early API idea and discussion, it is NOT ready for implementation labels Jul 6, 2022
@ghost
Copy link

ghost commented Jul 6, 2022

Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:

  • The PR contains changes to the reference-assembly that describe the API change. Or, you have included a snippet of reference-assembly-style code that illustrates the API change.
  • The PR describes the impact to users, both positive (useful new APIs) and negative (breaking changes).
  • Someone is assigned to "champion" this change in the meeting, and they understand the impact and design of the change.

@davidfowl davidfowl added the area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels label Jul 6, 2022
@davidfowl davidfowl added this to the .NET 7 Planning milestone Jul 6, 2022
@ghost
Copy link

ghost commented Jul 6, 2022

Thanks for contacting us.

We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@halter73
Copy link
Member

halter73 commented Jul 6, 2022

API review notes:

  1. This is very nice to have when writing your own GetGroupedEndpoints implementation in an EndpointDataSource.
  2. Do we think left should be nullable? Yes. It's convenient when called from Endpoints.

API Approved!

namespace Microsoft.AspNetCore.Routing.Patterns;

public static class RoutePatternFactory
{
+    public static RoutePattern Combine(RoutePattern? left, RoutePattern right);
}

@halter73 halter73 added api-approved API was approved in API review, it can be implemented and removed api-ready-for-review API is ready for formal API review - https://github.com/dotnet/apireviews labels Jul 6, 2022
@davidfowl davidfowl modified the milestones: .NET 8 Planning, 7.0-rc1 Aug 12, 2022
@davidfowl davidfowl self-assigned this Aug 12, 2022
@davidfowl
Copy link
Member Author

Fixed

@ghost ghost locked as resolved and limited conversation to collaborators Sep 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-approved API was approved in API review, it can be implemented area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants