com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field

If you don’t want to have a setter in your bean and only use fields and getters, you can use the visibility checker of ObjectMapper to allow field visibility.
Something like following:

ObjectMapper mapper = new ObjectMapper();
mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
mapper.setVisibility(VisibilityChecker.Std.defaultInstance().withFieldVisibility(JsonAutoDetect.Visibility.ANY));

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)