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

Support base64 strings in `getBinaryValue()` for CBOR and Smile #284

Closed hherman1 closed 3 years ago

hherman1 commented 3 years ago

Adds support for deserializing base64 strings as binary. Elasticsearch returns base64 strings for binary fields, not native binary.

cowtowncoder commented 3 years ago

Sounds reasonable, although I'd probably have to check if this is similar to what other backends do (I think ParserBase has something similar already). It would be nice to also have a unit test showing simple usage and verify correct operation?

But one request: could you rebase this against 2.13? Master branch is for Jackson 3.0 which is still some ways off, so this change would make sense for 2.13 which will be released much sooner.

cowtowncoder commented 3 years ago

Thanks! I created a bit bigger patch to also support this for Smile, and for alternative access method, and for 2.13 branch.

hherman1 commented 3 years ago

Thanks so much! Sorry I dropped this, but glad we’ll be able to remove this code from our code base! :)

cowtowncoder commented 3 years ago

@hherman1 No problem, was easy to add just needed to have a bit of time :)