I\'m calling an aws lambda with a json body. So the fields of the json are with different name from the ones in the POJO. So what I did is to add @JsonProperty on the fields
It sounds like you have version mismatch between annotation types, and databind (ObjectMapper
): both MUST be the same major version. Specifically, Jackson 1.x annotations work with Jackson 1.x databind; and 2.x with 2.x.
Difference is visible via Java package: Jackson 1.x uses org.codehaus.jackson
, whereas Jackson 2.x uses com.fasterxml.jackson
. Make sure to import right annotations for ObjectMapper
you use.