square / square/wire

Wire doesn’t support RPC methods with `StringValue` return types, or any wrappers

Open
#1,912 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
4.4k
Forks
627
Avg merge
3d 15m
Merged PRs (30d)
20

Description

import "google/protobuf/wrappers.proto";

service StringValueService {
  rpc Hello(google.protobuf.StringValue) returns (google.protobuf.StringValue) {}
}

Wire turns StringValue into String?, and that doesn’t work because GrpcCall requires response and request types are non-null.

I made a quick attempt at supporting this, but I ran into a brick wall with MessageSource.read(). That function uses null to indicate end-of-stream, which collides with the potential for a true null response value.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use the shown StringValueService definition as the reproduction case. Read MessageSource.read() and the GrpcCall request and response constraints first, then trace how Wire turns wrapper types into nullable values. Done means wrapper-based RPC methods can be supported without confusing a true null response with end-of-stream.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, kotlin
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.