CBOR serialization and removing RFC7049#2.4 type hints #516
-
I am working with a CBOR data structure which I am attempting to serialize from a HashMap. I have specific requirements on the CBOR encoding, the requirement I am having troubles with is The requirement I have is that CBOR I generate cannot have any item tags (as defined in section 2.4 of RFC7049) Currently the CBOR I am generating has the following structure: parsed: note the "tag(2)" entries which are a type hint for the byte array values in the map. The output I need is as follows: parsed: Is there a Jackson class I can override to stop generating these tags? I have been trying to override ArraySerializerBase.java and MapEntrySerializer.java with no success |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Ok this is wrong place: CBOR is under |
Beta Was this translation helpful? Give feedback.
-
Ok so, no, you cannot force this easily from databind level (where JsonSerializers are defined) which is format-agnostic. None of serializers know of actual underlying format, or encoding details. So ability to suppress type tags/hints would need to be done at streaming API level, probably by adding
(where FEATURE_NAME would be like and then making Above is my initial thinking without considering any of the details (and only vaguely remembering how type tags / hints were used). |
Beta Was this translation helpful? Give feedback.
Ok so, no, you cannot force this easily from databind level (where JsonSerializers are defined) which is format-agnostic. None of serializers know of actual underlying format, or encoding details.
So ability to suppress type tags/hints would need to be done at streaming API level, probably by adding
(where FEATURE_NAME would be like
USE_TYPE_TAGS
orUSE_TYPE_TAG_xxx
)and then making
CBORGenerator
take that into account when encoding.Above is my initial thinking without considering any of the details (and only vaguely remembering how type tags / hints were used).