You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@JsonSubTypes({ @JsonSubTypes.Type(value = LinkSettings.Action.class, name = "action"), ... }), and
@JsonTypeName
to (de)serialize a sealed interface LinkSettings whose subtypes are records nested in that very interface as well as another sealed interface (sealed interface Action).
I have tests that serialize values of this type with
When I migrate to Jackson 3.2.1, the serialization tests start failing, as the configured type name of the sealed interface appears to be ignored, and the type is traversed all to the bottom of the hierarchy (record OpenWindow being one the impls of Action):
expected: "action"
but was: "LinkSettings$Action$OpenWindow"
I was able to "fix" this by removing the writerFor call (that imo was already questionable before):
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have some code that makes use of various Jackson features including
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type"),@JsonSubTypes({ @JsonSubTypes.Type(value = LinkSettings.Action.class, name = "action"), ... }), and@JsonTypeNameto (de)serialize a
sealed interface LinkSettingswhose subtypes are records nested in that very interface as well as another sealed interface (sealed interface Action).I have tests that serialize values of this type with
working on Jackson 2.22.0.
When I migrate to Jackson 3.2.1, the serialization tests start failing, as the configured type name of the sealed interface appears to be ignored, and the type is traversed all to the bottom of the hierarchy (
record OpenWindowbeing one the impls ofAction):I was able to "fix" this by removing the
writerForcall (that imo was already questionable before):Now I hit the same issue with deserialization, but there I cannot replace
with
Is this expected, or a symptom of a misconfiguration/misuse of annotations?
Or is this a bug and I should try to create a reproduction for it?
All reactions