Skip to content

Commit

Permalink
AVRO-4071: put the recorde schema to the context after adding the fields
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabettich committed Oct 7, 2024
1 parent ec2378b commit 9524843
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lang/java/avro/src/main/java/org/apache/avro/Schema.java
Original file line number Diff line number Diff line change
Expand Up @@ -1862,7 +1862,6 @@ private static Schema parseRecord(JsonNode schema, ParseContext context, String
Name name = parseName(schema, currentNameSpace);
String doc = parseDoc(schema);
Schema result = new RecordSchema(name, doc, isTypeError);
context.put(result);

JsonNode fieldsNode = schema.get("fields");
if (fieldsNode == null || !fieldsNode.isArray())
Expand All @@ -1877,6 +1876,7 @@ private static Schema parseRecord(JsonNode schema, ParseContext context, String
name, f.name(), getOptionalText(field, "logicalType"));
}
result.setFields(fields);
context.put(result);
parsePropertiesAndLogicalType(schema, result, SCHEMA_RESERVED);
parseAliases(schema, result);
return result;
Expand Down

0 comments on commit 9524843

Please sign in to comment.