Skip to content

Commit

Permalink
alert for unexpected format values when type==ANY
Browse files Browse the repository at this point in the history
  • Loading branch information
vchudnov-g committed Oct 10, 2024
1 parent 3c89106 commit f2db138
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f2db138

Please sign in to comment.