GrpcClient.Builder's baseUrl path segments get ignored
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 4.4k
- Forks
- 627
- Avg merge
- 3d 15m
- Merged PRs (30d)
- 20
Description
When using the compiler to generate a Kotlin client, the GrpcMethod.paths that are generated are absolute. For example /greeter.HelloService/SayHello. The GrpcClient.Builder takes a baseUrl, but since the paths are absolute, and path segments of the baseUrl are discarded when GrpcClient#newCall runs.
If the paths were relative, greeter.HelloService/SayHello (no leading slash), then the baseUrl containing path segments would work fine.
My use case is that I'm adding gRPC to an existing application, and am being asked to deploy it at a path like /appName/grpc/*.
My workaround is an OkHttp interceptor that rewrites the request URL to include the path components I need.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how GrpcClient.Builder's baseUrl is used in GrpcClient#newCall and how generated GrpcMethod.path values are formed by the compiler. Reproduce the absolute-path behavior with a baseUrl containing path segments, then verify that requests preserve those segments while continuing to target the generated gRPC method path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100