Skip to content

JsonSetter.contentNulls is ignored if the deserialization result from a token that is not JsonToken.VALUE_NULL is null. #5165

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

Open
1 task done
k163377 opened this issue May 18, 2025 · 4 comments
Labels
to-evaluate Issue that has been received but not yet evaluated

Comments

@k163377
Copy link
Contributor

k163377 commented May 18, 2025

Search before asking

  • I searched in the issues and found nothing similar.

Describe the bug

This is a follow-up to the following issues
#5139 (fixed via PR #5140)
FasterXML/jackson-module-kotlin#976

In the deserializer inheriting from ContainerDeserializerBase, I found problems in the following classes

The StringArrayDeserializer does not inherit from the ContainerDeserializerBase, but seems to have the same problem.
There may be other deserializers with similar problems, but I have not been able to verify them.

The MapEntryDeserializer was not using _nullProvider.
However, it has not been confirmed that there is no problem with not using _nullProvider.

Version Information

2.19.0(2.19.1-SNAPSHOT)

Reproduction

Same as #5139

Expected behavior

If the deserialization result of the value is null, then JsonSetter.contentNulls must work.

Additional context

No response

@k163377 k163377 added the to-evaluate Issue that has been received but not yet evaluated label May 18, 2025
@JooHyukKim
Copy link
Member

Is there reproduction u can share? If its difficult to convert to Java, even maybe in Kotlin version would be good starting point

@k163377
Copy link
Contributor Author

k163377 commented May 18, 2025

For MapDeserializer, it is easy to reproduce since the conversion from empty string to Integer returns null(see this).
The ObjectArrayDeserializer may be reproduced in the same way.

As for the others, I don't think they can be reproduced without defining a custom deserializer that returns null for the value.

If you need all the reproducible cases, please give me some time to create them.
I have a few things to do today, so all submissions will probably be due at the end of next week.

@cowtowncoder
Copy link
Member

I think creating one test, listing other likely types, is fine. Test PR can be against 2.19; can then see where fixes should go (2.19 or 2.x depending on how big/risky changes are).

k163377 added a commit to k163377/jackson-databind that referenced this issue May 24, 2025
k163377 added a commit to k163377/jackson-databind that referenced this issue May 24, 2025
@k163377
Copy link
Contributor Author

k163377 commented May 24, 2025

A PR has been issued to add a failing test.
#5174

The EnumSetDeserializer was not reported initially, but a case was added because of a similar problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to-evaluate Issue that has been received but not yet evaluated
Projects
None yet
Development

No branches or pull requests

3 participants