Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
Schema#toString and Protocol#toString both generate default values for "bytes" and "fixed" types.
According to docs:
Default values for bytes and fixed fields are JSON strings, where Unicode code points 0-255 are mapped to unsigned 8-bit byte values 0-255. Avro encodes a field even if its value is equal to its default.
The following schema
{ "type" : "record", "name" : "TestRecord", "fields" : [ { "name" : "testFixed", "type" : { "type" : "fixed", "name" : "Code", "size" : 3 }, "default" : "\u0009\u0020\u00FF" } ] }
If parsed and then again encoded to JSON would have "\t ÿ" value in "default".
It happens because `toString` implementations use `JsonGenerator` with default escape configs.
Attachments
Issue Links
- links to