|
|
-
GenericRecord.toString does not handle enums properlyJay Kreps 2010-12-15, 21:13
The output from GenericRecord.toString in Java is not valid JSON, for
example a record with the schema: { "type": "record", "name": "TestRecord", "fields" : [ {"name":"enum_field", "type":{"type":"enum", "symbols":["a", "b"], "name":"MyEnumType"}}, ] } Should be output as {"enum_field":"a"} but is output as {"emum_field":a} The later is not really JSON. I saw this on 1.4 but I think it exists on trunk too. Is this a known issue? I think the fix is just to add another special case in GenericData.toString()... -Jay |