klarna / erlavro

Avro support for Erlang/Elixir (http://avro.apache.org/)
Apache License 2.0
131 stars 39 forks source link

Parsing schema that has an object as a property value #88

Closed AlfUA closed 5 years ago

AlfUA commented 5 years ago

I'm usinn erlavro to decode messages from Kafka, that contains the following element structure:

{ "name":Limit", "type":["null",{ "type":"bytes", "scale":2, "precision":64, "connect.version":1, "connect.parameters":{"scale":"2"}, "connect.name":"org.apache.kafka.connect.data.Decimal", "logicalType":"decimal" }], "default":null }.

Decode function fails trying to find an unexisting clause of avro_util:ensure_binary/1, that doesn't handle the object cast ({"scale":"2"}). Could you please help with the issue?