Skip to content

Commit

Permalink
Register enums with goproto compiler
Browse files Browse the repository at this point in the history
The GRPC Gateway needs to read the enum definitions to properly
translate messages. However, it only reads these definitions from
goproto's registry, not gogoproto's registry. Luckily, gogoproto
supports this as an option.

See https://jbrandhorst.com/post/gogoproto/ for more information about
the tenuous compatibility between gogoproto and the GRPC gateway.
  • Loading branch information
Alex Burkhart authored and saterus committed Apr 22, 2022
1 parent 443ab90 commit d45766e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions broker/protocol/protocol.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ option (gogoproto.goproto_unrecognized_all) = false;
option (gogoproto.marshaler_all) = true;
option (gogoproto.protosizer_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.goproto_registration) = true;

// Status is a response status code, used universally across Gazette RPC APIs.
enum Status {
Expand Down
1 change: 1 addition & 0 deletions consumer/protocol/protocol.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ option (gogoproto.goproto_unrecognized_all) = false;
option (gogoproto.marshaler_all) = true;
option (gogoproto.protosizer_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.goproto_registration) = true;

// Status is a response status code, used across Gazette Consumer RPC APIs.
enum Status {
Expand Down

0 comments on commit d45766e

Please # to comment.