klarna / erlavro

Avro support for Erlang/Elixir (http://avro.apache.org/)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

default values of null not handled

randysecrist opened this issue · comments

Avro IDL can generate schema which allow default values of null for any type. Current erlavro decoder doesn't decode these.

I have a local change in the json decoder which allows the decoding; however if I update the interop with a field that has a default value of null; all kinds of things start to break.

I could just write a test that covers the decoding case I have and ignore any encoding changes for now.

Thoughts?

Go ahead send the pr

Info from the spec: (defaults seem to apply to readers (decoders) only for now).

default: A default value for this field, used when reading instances that lack this field (optional).

fixed in #51