Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Not A Problem
-
1.7.7
-
None
-
None
-
Pure java.
Description
The Json output of java generated code doesn't correctly encode byte arrays.
Using this simple schema :
{"namespace": "example.avro",
"type": "record",
"name": "ByteArrayEncoding",
"fields": [
]
}
The toString()
System.out.println(new ByteArrayEncoding(ByteBuffer.wrap(new byte[]
)));
Returns raw bytes to string in the json :
{"data": {"bytes": " ABC??"}}
As a byte array is not tied to be a valid string, it should be converted back and forth to Base64 like other Json implementations :
{"data": {"bytes": "AB9BQkP/tg=="}}