From dc155c88660866aa8f4eb254bedd6cc1b7a01f4b Mon Sep 17 00:00:00 2001 From: Mira Leung Date: Mon, 24 May 2021 13:05:47 -0700 Subject: [PATCH] fix: Support enums in proto HTTP annotations --- .../google/api/generator/gapic/protoparser/HttpRuleParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/google/api/generator/gapic/protoparser/HttpRuleParser.java b/src/main/java/com/google/api/generator/gapic/protoparser/HttpRuleParser.java index cd2ae640c9..10c9b1b071 100644 --- a/src/main/java/com/google/api/generator/gapic/protoparser/HttpRuleParser.java +++ b/src/main/java/com/google/api/generator/gapic/protoparser/HttpRuleParser.java @@ -148,7 +148,7 @@ private static void checkHttpFieldIsValid(String binding, Message inputMessage, Field field = inputMessage.fieldMap().get(binding); boolean fieldCondition = !field.isRepeated(); if (!isBody) { - fieldCondition &= field.type().isProtoPrimitiveType(); + fieldCondition &= field.type().isProtoPrimitiveType() || field.isEnum(); } String messageFormat = "Expected a non-repeated "