I currently having an issue with the Avro JsonDecoder. Avro is used in Version 1.8.2. The .avsc file is defined like:
{
"type": "record",
"namespace": "my.namespace",
"name": "recordName",
"fields": [
{
"name": "Code",
"type": "string"
},
{
"name": "CodeNumber",
"type": "string",
"default": ""
}
]
}
When I now run my test cases I get an org.apache.avro.AvroTypeException: Expected string. Got END_OBJECT
. The class throwing the error is JasonDecoder.
For me it looks like the defaut value handling on my side might not be correct with using just ""
as the default value. The error occurs only if the field is not available at all, but this, in my understanding, is the case when the default value should be used. If I set the value in the json as "CodeNumber": ""
the decoder does not have any issues.
Any hints or ideas?