Skip to content

RFE-4650: Single string value primitive array deserialization improvement#5022

Merged
cowtowncoder merged 2 commits into
FasterXML:2.19from
eeren-bm:RFE-4650-deserialize-single-string-into-primitive-arr
Mar 12, 2025
Merged

RFE-4650: Single string value primitive array deserialization improvement#5022
cowtowncoder merged 2 commits into
FasterXML:2.19from
eeren-bm:RFE-4650-deserialize-single-string-into-primitive-arr

Conversation

@eeren-bm

@eeren-bm eeren-bm commented Mar 12, 2025

Copy link
Copy Markdown
Contributor

(fixes #4650)

PrimitiveArrayDeserializers to deal with single value primitive when ACCEPT_SINGLE_VALUE_AS_ARRAY is enabled.

…tive when ACCEPT_SINGLE_VALUE_AS_ARRAY is enabled.
// Empty String can become null...
if (p.hasToken(JsonToken.VALUE_STRING)) {
if (p.hasToken(JsonToken.VALUE_STRING) && p.getText().isEmpty()) {
return _deserializeFromString(p, ctxt);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eeren-bm Have a look at this method in StdDeserializer... By-passing it will skip lots of potentially necessary processing, including CoercionConfig settings.

But I think we can get this to work by bit more re-factoring. Let me see if I can change it a bit.

@cowtowncoder
cowtowncoder merged commit 0e31167 into FasterXML:2.19 Mar 12, 2025
@cowtowncoder cowtowncoder added the cla-received PR already covered by CLA (optional label) label Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-received PR already covered by CLA (optional label)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PrimitiveArrayDeserializers should deal with single String value if DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY enabled

2 participants