Closed Strech closed 4 years ago
Hi.
The avro_binary_decoder:decode_stream/4
API can be updated to support a proplist for the last argument (in a backward compatible way), see: https://github.com/klarna/erlavro/blob/master/src/avro_binary_decoder.erl#L82-L84
And then expose this proplist as the 2nd arg fro avro_ocf:decode_file/2
.
With such API, the hook can be passed in as [{hook, Fun}]
.
@zmstone Exactly ππΌ I will try to attach PR to this issue (but I'm sorry for my Erlang skills in advance)
Hey guys, I want to say thanks for an amazing library ππΌ
Issue
I've been using it to provide an Elixir library Avrora and I'm missing a small piece of functionality β a decoder hook for OCF similar to the binary decoder hook.
Motivation
The need comes from handing
null
values of the primitive fields with a value ofNULL
. I would like to transform them intonil
values of Elixir. I can do it with a binary decoder via hook, but I can't with OCF.Proposal
I'm not sure about the interface (should it be the props list or just a hook) for OCF, but Idea is that the test might look like this
WDYT?