allegro/json-avro-converter

JsonEncoder is not public in avro

Opened this issue · 1 comments

Hi,

In the current implementation, NoWrappingJsonEncoder is using the constructors of JsonEncoder. However, since avro 1.5, the constructors are not public. Instead an object should be created through the supplied factory EncoderFactory.

Fixing this will be much appreciated.

Thanks!

Hi, I'm not sure if this is an issue. NoWrappingJsonEncoder is (hackishly) declared in org.apache.avro.io, thus we can access package-protected constructors. We need to do this, to override JsonEncoder#writeIndex method.

In the long run, it's possibly not the best approach (modules and all), but there is currently no other way to do this.