[685] Ensure the value type of a container being deserialized uses th…#686
Open
jamezp wants to merge 2 commits intoeclipse-ee4j:masterfrom
Open
[685] Ensure the value type of a container being deserialized uses th…#686jamezp wants to merge 2 commits intoeclipse-ee4j:masterfrom
jamezp wants to merge 2 commits intoeclipse-ee4j:masterfrom
Conversation
…e value types class model for custom deserialization. Do the same for serialization. Signed-off-by: James R. Perkins <jperkins@ibm.com>
jbaesner
reviewed
Nov 21, 2025
src/main/java/org/eclipse/yasson/internal/deserializer/DeserializationModelCreator.java
Outdated
Show resolved
Hide resolved
…ue. Added tests for wildcards on map keys and values, lists and optional. Signed-off-by: James R. Perkins <jperkins@ibm.com>
KyleAure
approved these changes
Dec 8, 2025
| final MapContainer container = new MapContainer(Map.of( | ||
| "key1", new TestImpl("value1"), | ||
| "key2", new TestImpl("value2") | ||
| ), Map.of("qKey1", "value1", "qKey2", "value2"), |
Member
There was a problem hiding this comment.
Suggested change
| ), Map.of("qKey1", "value1", "qKey2", "value2"), | |
| ), Map.of("qKey1", new TestImpl("value1"), "qKey2", new TestImpl("value2")), |
Question: I understand at runtime the deserializer would not be able to know it would have to use a specific @JsonbTypeDeserializer when a Wildcard generic type is used because it would not know the expected type.
However, I might expect a @JsonbTypeSerializer to honor the incoming type and still perform serialization even if the underlying property had a wildcard type.
Not necessary for this PR, but maybe something we should look to improve in the future.
Member
Author
There was a problem hiding this comment.
That makes sense. We could definitely do a follow up on that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…e value types class model for custom deserialization.
resolves #685