grpc-gateway: grpc-gateway_out does not entirely obey the -M parameter
Hi,
I’m using grpc-gateway_out with the github.com/gogo/protobuf project and I came across a case where the grpc-gateway generated code is invalid when using the -M parameter to the compiler.
When using the
google/protobuf/empty.proto
and want to replace the generated file with one from
github.com/gogo/protobuf/types/
via
grpc-gateway_out=Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types
the generated code will import
github.com/gogo/protobuf/types
as expected, but the code still uses the
empty.Empty
to reference the Empty struct.
This results in both an unused import and an undefined reference compile error. The correct action should be to use types.Empty
in the generated functions in this case.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 7
- Comments: 15
Commits related to this issue
- fix #229 make Message use the name of the mapped import — committed to Mistobaan/grpc-gateway by Mistobaan 6 years ago
At work I wrote a post-generate workaround for this in python: