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

Fix #4994 CoercionConfig for CoercionAction.AsNull not working on empty array deserialization #4999

Closed
wants to merge 9 commits into from

Conversation

JooHyukKim
Copy link
Member

fixes #4994

@@ -179,6 +179,22 @@ public String[] deserialize(JsonParser p, DeserializationContext ctxt) throws IO
}
String[] result = buffer.completeAndClearBuffer(chunk, ix, String.class);
ctxt.returnObjectBuffer(buffer);
if (result != null) {
Copy link
Member

Choose a reason for hiding this comment

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

Can never be null, let's remove check.

@cowtowncoder
Copy link
Member

Should probably cover a few other types if we do this: specifically test

  • Object[] ("untyped" arrays)
  • PojoType[] (that is, arrays of non-JDK bean type)

although I think both of these are handled by ObjectArrayDeserializer.

There are also ~7 or so primitive array deserializers but we can defer those I think.

@JooHyukKim
Copy link
Member Author

JooHyukKim commented Mar 1, 2025

Should probably cover a few other types if we do this: specifically test

  • Object[] ("untyped" arrays)
  • PojoType[] (that is, arrays of non-JDK bean type)

Will cover those two separately, if that's okay?

Never mind, decided to cover here

@JooHyukKim JooHyukKim changed the title Fix #4994 CoercionConfig not working on String[] Fix #4994 CoercionConfig not working on Array deserialization Mar 1, 2025
@JooHyukKim JooHyukKim changed the title Fix #4994 CoercionConfig not working on Array deserialization Fix #4994 CoercionConfig for CoercionAction.AsNull not working on empty array deserialization Mar 1, 2025
@JooHyukKim JooHyukKim requested a review from cowtowncoder March 3, 2025 01:59
@cowtowncoder
Copy link
Member

@JooHyukKim Apologies for wasted work here -- only now realized this is not how CoercionConfig is meant to be used. Will close.

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

Successfully merging this pull request may close these issues.

2 participants