Skip to content

Commit

Permalink
DGS-6373 Ignore leading dot when merging Protobuf custom options (#2577)
Browse files Browse the repository at this point in the history
  • Loading branch information
rayokota authored Mar 15, 2023
1 parent eab6ead commit b04f05e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ private static Map<String, OptionElement> mergeOptions(List<OptionElement> 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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit b04f05e

Please sign in to comment.