jackson-dataformats-binary
jackson-dataformats-binary copied to clipboard
Add support for reading Date type (defined using type tags)
Maybe I'm wrong but It seems to me currently there is no support for Date type for CBOR.
Is it something planned to support date like defined in RFC7049§2.4.1 ?
I think you are right; tagged types have been added over time, and were not there when the module was implemented.
Although implementing support is theoretically bit tricky since Jackson's streaming API does not have similar concept (it is very much CBOR specific approach, although Avro has somewhat similar concept of logical type; and the idea itself is pretty useful). But the one fallback mechanism -- exposing "native" types as JsonToken.VALUE_EMBEDDED_OBJECT, and making sure databind-level JsonDeserializers can take these into account -- exists and should work.
I'll label this as 2.13 since there is no time to implement this for 2.12.0; but given that it does not change API it could perhaps be introduce in a 2.12.x patch as well, if someone has time to implement it.
I'd be happy to help implement this if anyone has time to play around with the approach?
We currently hesitate between 2 CBOR library. If Jackson is chosen, I could maybe find time to work on this (with help because I didn't know so well Jackson). So nothing sure for now :confused:.
@sbernard31 Ok thank you for sharing this. I would be interested in helping with logical data types, as well as integration issues. If you (or anyone else) has time, we could perhaps collaborate; and some of support could well be included in 2.12.x patches.
(updated title a bit -- there may be need to support writing of values, too, but that will need different technical solution; two sides are not tightly coupled in this area)