Skip to content

Conversation

@jamezp
Copy link
Member

@jamezp jamezp commented Oct 15, 2025

…e value types class model for custom deserialization.

resolves #685

…e value types class model for custom deserialization. Do the same for serialization.

Signed-off-by: James R. Perkins <jperkins@ibm.com>
…ue. Added tests for wildcards on map keys and values, lists and optional.

Signed-off-by: James R. Perkins <jperkins@ibm.com>
final MapContainer container = new MapContainer(Map.of(
"key1", new TestImpl("value1"),
"key2", new TestImpl("value2")
), Map.of("qKey1", "value1", "qKey2", "value2"),
Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

That makes sense. We could definitely do a follow up on that.

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.

@JsonbTypeDeserializer and @JsonbTypeSerializer annotations not recognized for types used in container elements/values

3 participants