From d45766e8afc93a9ae519e16f23cd18c56a23840e Mon Sep 17 00:00:00 2001 From: Alex Burkhart Date: Fri, 22 Apr 2022 11:35:29 -0400 Subject: [PATCH] Register enums with goproto compiler 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. --- broker/protocol/protocol.proto | 1 + consumer/protocol/protocol.proto | 1 + 2 files changed, 2 insertions(+) diff --git a/broker/protocol/protocol.proto b/broker/protocol/protocol.proto index 812de076..7cc45e41 100644 --- a/broker/protocol/protocol.proto +++ b/broker/protocol/protocol.proto @@ -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 { diff --git a/consumer/protocol/protocol.proto b/consumer/protocol/protocol.proto index 02ef2505..26b5ecb6 100644 --- a/consumer/protocol/protocol.proto +++ b/consumer/protocol/protocol.proto @@ -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 {