Skip to content

Commit

Permalink
Merge pull request #3154 from confluentinc/pr_merge_from_7_3_x_to_7_4_x
Browse files Browse the repository at this point in the history
Merge Conflict Resolution (from 7.3.x to 7.4.x)
  • Loading branch information
rayokota authored Jun 14, 2024
2 parents e4a78b1 + 23e1655 commit 0b6699d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1785,7 +1785,12 @@ public static Map<String, String> findParams(Optional<OptionElement> meta) {
if (result == null) {
return null;
} else if (result instanceof Map) {
return (Map<String, String>) result;
Map<String, String> params = new LinkedHashMap<>();
Map<String, String> keyValue = (Map<String, String>) result;
String key = keyValue.get(KEY_FIELD);
String value = keyValue.get(VALUE_FIELD);
params.put(key, value);
return params;
} else if (result instanceof List) {
List<Map<String, String>> keyValues = (List<Map<String, String>>) result;
Map<String, String> params = new LinkedHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
import io.confluent.kafka.schemaregistry.protobuf.ProtobufSchemaUtils.FormatContext;
import io.confluent.kafka.schemaregistry.protobuf.dynamic.DynamicSchema;
import io.confluent.kafka.schemaregistry.protobuf.dynamic.MessageDefinition;

import io.confluent.protobuf.MetaProto;
import io.confluent.protobuf.MetaProto.Meta;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -1643,6 +1644,10 @@ public void testParams() {
+ " }];\n"
+ "}";
ProtobufSchema schema = new ProtobufSchema(schemaString);
FieldDescriptor fd = schema.toDescriptor().findFieldByName("MIT_ACTUAL_PRICE");
Meta meta = fd.getOptions().getExtension(MetaProto.fieldMeta);
assertEquals("2", meta.getParamsOrThrow("scale"));

// Ensure we can process params when creating a dynamic schema
assertNotNull(schema.toDynamicSchema());
}
Expand Down

0 comments on commit 0b6699d

Please sign in to comment.