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
1-argument constructors are fundamentally ambiguous: for example, POJO like:
public class Bean {
@JsonCreator
public Bean(String key) { ... }
}
could be expected to match either JSON String like
"value"
OR JSON Object
{ "key": "value" }
where first case is "Delegating" (full JSON value is Delegated as-is) and second case "Properties-based" (since incoming Object's property/properties are matched into separate properties -- 1-argumenet case is just a special case).
So Jackson has to use heuristics to decide which one to use. There are a few hints being checked (such as existence of @JsonValue strongly suggesting Delegating case; and existence of Field/setter/getter with name matching argument name suggesting Properties based case).
It sounds like behavior changed from 2.17 to 2.18, at least for Kotlin module, in a way that formerly Delegating cases were now decided as Properties-ones.
But it might be possible to change that heuristics such that if the parameter type is java.util.Map, chances are we have Delegating case (could extend to consider Collection and/or JsonNode as well).
The text was updated successfully, but these errors were encountered:
(note: created from FasterXML/jackson-module-kotlin#846)
1-argument constructors are fundamentally ambiguous: for example, POJO like:
could be expected to match either JSON String like
OR JSON Object
where first case is "Delegating" (full JSON value is Delegated as-is) and second case "Properties-based" (since incoming Object's property/properties are matched into separate properties -- 1-argumenet case is just a special case).
So Jackson has to use heuristics to decide which one to use. There are a few hints being checked (such as existence of
@JsonValue
strongly suggesting Delegating case; and existence of Field/setter/getter with name matching argument name suggesting Properties based case).It sounds like behavior changed from 2.17 to 2.18, at least for Kotlin module, in a way that formerly Delegating cases were now decided as Properties-ones.
But it might be possible to change that heuristics such that if the parameter type is
java.util.Map
, chances are we have Delegating case (could extend to considerCollection
and/orJsonNode
as well).The text was updated successfully, but these errors were encountered: