Investigate problem with use of part of message
johanbrandhorst opened this issue · 3 comments
johanbrandhorst commented
At work I ran into a problem with the following definition:
service Bla {
rpc GetBla(GetBlaRequest) returns (Bla) {
option (google.api.http) = {
post: "/api/v1/{bla_id}"
body: "bla"
};
}
message Bla {
string something = 1;
}
message GetBlaRequest {
string bla_id = 1;
Bla bla = 2;
}
It resulted in an error like:
unexpected type **bla.Bla does not implement proto.Message
The error originates from this line in the generated grpc-gateway code:
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Bla); err != nil {
I have seen errors like this before in the github.com/gogo/gateway JSONPb
marshaller, but thought they were fixed. Investigate whether this is a problem still.
johanbrandhorst commented
It may be this issue should be moved to github.com/gogo/gateway, but I want to reproduce it first.
johanbrandhorst commented
This seems to be working in
grpc-example/proto/example.pb.gw.go
Line 98 in 8c29208
johanbrandhorst commented
I don't think this is an issue anymore.