diff --git a/protobuf-provider/src/main/java/io/confluent/kafka/schemaregistry/protobuf/ProtobufSchema.java b/protobuf-provider/src/main/java/io/confluent/kafka/schemaregistry/protobuf/ProtobufSchema.java index 328572f52c8..4699a94865a 100644 --- a/protobuf-provider/src/main/java/io/confluent/kafka/schemaregistry/protobuf/ProtobufSchema.java +++ b/protobuf-provider/src/main/java/io/confluent/kafka/schemaregistry/protobuf/ProtobufSchema.java @@ -1132,7 +1132,7 @@ private static Map mergeOptions(List optio // which may not be using the alternative aggregate syntax. return options.stream() .collect(Collectors.toMap( - OptionElement::getName, + o -> o.getName().startsWith(".") ? o.getName().substring(1) : o.getName(), o -> o, ProtobufSchema::merge)); } diff --git a/protobuf-provider/src/test/java/io/confluent/kafka/schemaregistry/protobuf/ProtobufSchemaTest.java b/protobuf-provider/src/test/java/io/confluent/kafka/schemaregistry/protobuf/ProtobufSchemaTest.java index adda20d4ed9..d21bf6f2eaf 100644 --- a/protobuf-provider/src/test/java/io/confluent/kafka/schemaregistry/protobuf/ProtobufSchemaTest.java +++ b/protobuf-provider/src/test/java/io/confluent/kafka/schemaregistry/protobuf/ProtobufSchemaTest.java @@ -417,7 +417,7 @@ public void testComplexCustomOptions() { + "option java_multiple_files = true;\n" + "option (com.custom.map).subject = 'user-value';\n" + "option (com.custom.map).compatibility_mode = FULL;\n" - + "option (confluent.file_meta).doc = \"file meta\";\n" + + "option (.confluent.file_meta).doc = \"file meta\";\n" + "option (confluent.file_meta).params = [\n" + " {\n" + " value: \"my_value\",\n" @@ -438,7 +438,7 @@ public void testComplexCustomOptions() { + "option java_multiple_files = true;\n" + "option (com.custom.map).subject = \"user-value\";\n" + "option (com.custom.map).compatibility_mode = FULL;\n" - + "option (confluent.file_meta).doc = \"file meta\";\n" + + "option (.confluent.file_meta).doc = \"file meta\";\n" + "option (confluent.file_meta).params = [{\n" + " value: \"my_value\",\n" + " key: \"my_key\"\n"