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

Add @AvroNamespace annotation to override Avro type namespace #324

Closed MichalFoksa closed 2 years ago

MichalFoksa commented 2 years ago

New AvroNamespace annotation to override default Avro type namespace.

Simple way how to override default Avro namespace value with a new, custom, annotation.

This solves #310.

Is the new annotation package OK?

com.fasterxml.jackson.dataformat.avro.AvroFixedSize              -  the only existing annotation
com.fasterxml.jackson.dataformat.avro.annotations.AvroNamespace  - new annotation
cowtowncoder commented 2 years ago

but one thing is that this cannot go in 2.13 patch since it is both slightly backwards-incompatible (changes method signature of the helper method) and (more importantly) adds a new annotation type. So please re-base against 2.14.

EDIT: Removed a former comment wrt Ion -- for some reason, got things mixed up.

MichalFoksa commented 2 years ago

PR is now rebased on 2.14.

cowtowncoder commented 2 years ago

Thank you @MichalFoksa!

Also, apologies for nonsensical comment wrt Ion & Amazon developers. This is for Avro, but somehow I managed to get things fixed.

I'll try to get this reviewed soon,

MichalFoksa commented 2 years ago

@cowtowncoder

No problem, really - I understand :).

I have updated my commit - just reorganized imports in AvroSchemaHelper. Moved imports from com.fasterxml.jackson together.

cowtowncoder commented 2 years ago

Will merge: will also change package name from "...avro.annotations" to "...avro.annotation", just to be consistent with other Jackson packages (jackson-annotations, jackson-databind, jackson-dataformat-xml).

cowtowncoder commented 2 years ago

Thank you again @MichalFoksa for contributing this! It will go in 2.14.0 once we get there.

MichalFoksa commented 2 years ago

@cowtowncoder No problem - thank you for your time!