protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

Support field mask population by grpc-gateway

Open tzachshabtay opened this issue 4 years ago • 0 comments

We're using gogo-proto together with grpc-gateway and trying to use the patch feature from grpc-gateway to automatically update the field mask based on the fields on the REST request.

The dominant example of how to use gogo-proto and grpc-gateway together actually disables this feature (and also doesn't really work).

The problem is that the field mask type from gogo-proto is not the same as the field mask type from grpc-gateway, so we get a build error: cannot use fieldMask (type *field_mask.FieldMask) as type *types.FieldMask in assignment.

The field mask type used by gateway: "google.golang.org/genproto/protobuf/field_mask".FieldMask

The field mask type used by gogo: "github.com/gogo/protobuf/types".FieldMask

Is there any workaround to make them work together?

tzachshabtay avatar Feb 25 '20 19:02 tzachshabtay