FasterXML / jackson-dataformats-binary

Uber-project for standard Jackson binary format backends: avro, cbor, ion, protobuf, smile
Apache License 2.0
310 stars 133 forks source link

[Avro] Remove dependencies upon Jackson 1.X and Avro's JacksonUtils #195

Closed baharclerode closed 4 years ago

baharclerode commented 4 years ago

This is the first half of a fix for #167

This removes the references to Jackson 1.x and JacksonUtils (which is internal to Avro), allowing Jackson-Avro to be binary-compatible Avro 1.9 or Avro 1.8 but not semantically-compatible in all cases, particularly around nested classes; For simple use-cases, this is sufficient to allow Jackson-Avro to work with Avro 1.9, but I would not by any means call it "supported" due to the nasty gotchas that still lurk.

This does not provide full backwards and forwards compatibility with Avro 1.9; Notably:

Fixing of the above will probably require porting all of the Avro union resolver code into Jackson-Avro with modifications to allow it to resolve both 1.8- and 1.9-styled namespaces, and a mapper flag that indicates if you want 1.8 or 1.9-compatibility for @AvroAlias annotations and generated schemas.

cowtowncoder commented 4 years ago

Thanks! I'll make a minor post-merge change probably to isolate use of ObjectMapper, but other than that it's the first big step.

cowtowncoder commented 4 years ago

Merged; did some minor renaming.

cowtowncoder commented 4 years ago

Turns out I had to do some more tweaking in 3.0, to avoid breaking #145. Not sure if similar "null masking" might be needed for 2.x, come to think of that (that is, when converting from NullNode, should use JsonProperties.NULL_VALUE, to retain "explicit null as default" vs "no default value).