diff --git a/src/main/java/com/google/cloud/discotoproto3converter/proto3/DocumentToProtoConverter.java b/src/main/java/com/google/cloud/discotoproto3converter/proto3/DocumentToProtoConverter.java index 2dfeb29..4c3cd87 100644 --- a/src/main/java/com/google/cloud/discotoproto3converter/proto3/DocumentToProtoConverter.java +++ b/src/main/java/com/google/cloud/discotoproto3converter/proto3/DocumentToProtoConverter.java @@ -545,10 +545,16 @@ private Field schemaToField(Schema sch, boolean optional, String debugPreviousPa valueType = Message.PRIMITIVES.get("google.protobuf.Value"); this.usesStructProto = true; break; - case ANY: + case EMPTY: // intentional fall-through - default: + case ANY: valueType = Message.PRIMITIVES.get("google.protobuf.Any"); + break; + default: + throw new IllegalStateException( + String.format( + "unexpected 'format' value ('%s') when processing ANY type in schema %s", + sch.format().toString(), debugCurrentPath)); } break; case ARRAY: