gogo/grpc-example

Investigate problem with use of part of message

johanbrandhorst opened this issue · 3 comments

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.

It may be this issue should be moved to github.com/gogo/gateway, but I want to reproduce it first.

This seems to be working in

if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.User); err != nil {
. Will need to do further investigation.

I don't think this is an issue anymore.