-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Further fixes to #1654: @JsonDeserialize(contentUsing) ignored when @JsonTypeInfo(use = Id.NONE)
#5479
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
base: 3.x
Are you sure you want to change the base?
Conversation
…TypeInfo(use=NONE)
|
Thank you @JacksonJang -- sounds like possible path forward. I think I can merge #5477 first, then update this PR, re-review to make sure. I really appreciate your help here! |
|
Sounds great, thank you! I’ll wait for #5477 to be merged and then update this PR accordingly. Happy to continue refining the fix together :) |
@JsonDeserialize(contentUsing) ignored when @JsonTypeInfo(use = Id.NONE)@JsonDeserialize(contentUsing) ignored when @JsonTypeInfo(use = Id.NONE)
|
@JacksonJang Ok, I added the missing test case, probably need fix in |
|
Thanks for adding the missing test case. I agree that BasicSerializerFactory needs a similar fix. I’ll update the serializer side to mirror the changes in BasicDeserializerFactory and push an update to this PR. |
|
@cowtowncoder
|
|
@JacksonJang I think both are expected to pass -- but Unless I misunderstood question here? EDIT: let me double-check above so I did not make a mistake... :) |
|
Sorry for the confusion, I didn’t explain my point clearly earlier.
Since Please let me know if I’m misunderstanding the intention of the test setup. [AS-IS] [TO-BE] |
|
@JacksonJang Yes, I think you are correct: I broke that test. Good catch. Let me fix that. |
|
Done. Now fails in a bit more interesting way. :) |
|
Thanks for taking a look and confirming :) |
|
@JacksonJang Ok: I have possible fix for this issue: which does work, but I am wondering if there is a way to do it better in |
|
@JacksonJang With |
|
I'm also looking for a way to resolve this within In the meantime, I’ll keep exploring possible solutions in
|
|
@JacksonJang There's no hurry so I'll let you investigate. Just let me know if you feel you are not making progress and we can go with my work-around. |
|
Thank you :) |
|
I added the following branch to the code: With this change, all tests are passing. In |
Issue: #1654
Reference: #5477
In BasicDeserializerFactory, when creating a deserializer via createCollectionDeserializer(...),
I added logic so that if contentTypeDeser is an instance of NoOpTypeDeserializer, it is treated as null.
This ensures that @JsonDeserialize(contentUsing = ...) is applied correctly.
I’d appreciate it if you could review this when you have a moment.