Skip to content

Allow String-to-byte[] coercion for String-value collections #2535

@cowtowncoder

Description

@cowtowncoder

(note: follow-up for FasterXML/jackson-dataformats-binary#188)

So: currently binary values (supported by some binary formats, but not textual formats like JSON or XML) can be coerced into String values (see StringDeserializer.deserialize() special case for JsonToken.VALUE_EMBEDDED_OBJECT); same is true for Tree Model based handling.
This is implemented by re-encoding binary as Base64 content.
However, specialized String-value collection/array deserializers are missing this case: they use method "_parseString()" from StdDeserializer.

Given that default String handling does this, it makes sense to support same coercion for container cases.

Note: testing probably needs to be done from format modules as JSON backend can not induce VALUE_EMBEDDED_OBJECT tokens (although testing handling of TokenBuffer might make sense -- maybe easiest still via binary codecs): for example, from cbor backend for which original issue was reported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions