-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
2.18Issues planned at 2.18 or laterIssues planned at 2.18 or later
Milestone
Description
Search before asking
- I searched in the issues and found nothing similar.
Describe the bug
We maintain a large codebase which has some legacy classes that use Hungarian notation and lombok,
Deserialization used to work up until the 2.18 update where jackson is no longer respecting the @ConstructorProperties
to match the constructor properties and we are now seeing cannot deserialize from Object value (no delegate- or property-based Creator)
errors.
This may be related to INFER_CREATOR_FROM_CONSTRUCTOR_PROPERTIES
and the recent rewrite POJO Property Introspection
Version Information
2.18.2
Reproduction
@Test
void deserialization() throws JsonProcessingException {
var json =
"""
{
"value": "test"
}
""";
var result = new ObjectMapper().readValue(json, Something.class); // throws error
assertEquals("test", result.getValue());
}
private static class Something {
@JsonProperty("value")
private final String _value;
String getValue() {
return _value;
}
@JsonCreator
@ConstructorProperties({"value"})
Something(String pValue) {
_value = pValue;
}
}
Expected behavior
jackson should be able to leverage @ConstructorProperties
for the @JsonCreator
Additional context
No response
Metadata
Metadata
Assignees
Labels
2.18Issues planned at 2.18 or laterIssues planned at 2.18 or later