Description
Using this ticket as a base reference: https://issues.apache.org/jira/browse/AVRO-1545
The same problem is happening in the C# version as well.
Given:
{ "type" : "record", "name" : "BrokenRecord", "namespace" : "whatever", "fields" : [ { "name" : "a_string", "type" : { "type" : "string", "foobar" : "some example here" } } ] }
The property "foobar" will be lost when parsing the schema.
The fix that my team has implemented is modifying this line (file used from release 1.9.2)
https://github.com/apache/avro/blob/bf20128ca6138a830b2ea13e0490f3df6b035639/lang/csharp/src/apache/main/Schema/PrimitiveSchema.cs#L85
And replacing it with the following:
if(this.Props != null && this.Props.Count > 0) { w.WriteStartObject(); w.WritePropertyName("type"); w.WriteValue(Name); foreach(var prop in Props) { w.WritePropertyName(prop.Key); w.WriteRawValue(prop.Value); } w.WriteEndObject(); } else w.WriteValue(Name);
Another somewhat related ticket: https://issues.apache.org/jira/browse/AVRO-1346