Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cowtowncoder opened this issue Nov 7, 2019 · 1 comment
Closed

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

cowtowncoder opened this issue Nov 7, 2019 · 1 comment
Milestone

Comments

@cowtowncoder
Copy link
Member

cowtowncoder commented Nov 7, 2019

(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.

@cowtowncoder
Copy link
Member Author

Will be fixed in 2.10.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant