Closed
Description
I believe Jackson Auto Configuration in Spring should set ConstructorDetector.USE_PROPERTIES_BASED flag out of the box:
objectMapper.setConstructorDetector(com.fasterxml.jackson.databind.cfg.ConstructorDetector.USE_PROPERTIES_BASED);
Background can be found here: FasterXML/jackson-databind#1498 and my tldr version is (I've been involved since the start of this in 2014...): Due to backwards compatibility concerns this can't be changed in Jackson itself but on the other hand this surprises a lot of Jackson users as the whole Java industry moves slowly forward to immutable by default way of thinking.
With this enabled users should be able to deserialize classes without any exceptions or surprises:
class Foo {
private final Bar bar;
Foo(Bar bar) {
this.bar = bar;
}
}