klarna / erlavro

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

Allow for the absence of codec with decoding ocf #81

Closed gfikes closed 6 years ago

gfikes commented 6 years ago

In regards to avro.codec when decoding ocf, The Apache Avro docs state the following:

Implementations are required to support the following codecs: "null" and "deflate". If codec is absent, it is assumed to be "null".

When trying to decode an ocf file when codec is absent, I get the following error:

** (CaseClauseError) no case clause matching: false
    (erlavro) src/avro_ocf.erl:261: :avro_ocf.get_codec/1
    (erlavro) src/avro_ocf.erl:75: :avro_ocf.decode_binary/1

This change simply sets the codec to null when it is absent from the file.

coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 541


Totals Coverage Status
Change from base Build 538: 0.0006%
Covered Lines: 1669
Relevant Lines: 1686

💛 - Coveralls
zmstone commented 6 years ago

@gfikes thanks! the new lines are not covered by tests, could you add a test case for it?

zmstone commented 6 years ago

and please bump version number to 2.7.1 in .app.src

zmstone commented 6 years ago

tagged 2.7.1, also published to hex. thank you @gfikes