Skip to content

Conversation

@feiyun0112
Copy link
Contributor

fix #64879

Copilot AI review requested due to automatic review settings December 29, 2025 08:01
@github-actions github-actions bot added the area-grpc Includes: GRPC wire-up, templates label Dec 29, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Dec 29, 2025
@dotnet-policy-service
Copy link
Contributor

Thanks for your PR, @@feiyun0112. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an issue where gRPC SwaggerGen incorrectly generates conflicting OpenAPI paths for HTTP transcoding patterns that use the same variable name with different literal path segments (e.g., /v1/{name=widgets/*} and /v1/{name=things/*}).

Key Changes:

  • Modified path resolution logic to include literal segments from multi-segment route patterns in the generated OpenAPI paths
  • Added comprehensive test coverage for Google AIP-131 style resource patterns
  • Ensures unique OpenAPI paths are generated even when gRPC patterns use the same parameter name

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
GrpcJsonTranscodingDescriptionProvider.cs Updated ResolvePath method to expand multi-segment variables by including literal segments, ensuring unique OpenAPI paths
resources.proto Added test proto file defining a ResourceService with three methods using patterns with different literal segments
ResourceService.cs Added test service implementation inheriting from generated gRPC service base
ResourcePathTests.cs Added test validating that conflicting patterns generate unique OpenAPI paths with correct parameter mappings
Microsoft.AspNetCore.Grpc.Swagger.Tests.csproj Added reference to the new resources.proto file for code generation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-grpc Includes: GRPC wire-up, templates community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gRPC SwaggerGen does not handle conflicting paths

1 participant