bug: wrong version of jackson-databind in serialization module #1471
Labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
good-first-issue
Good for newcomers
maven
priority:2
High - core feature or affects 60% of the users
According to the documentation on https://docs.powertools.aws.dev/lambda/java/utilities/serialization/, I have to:
a) Add the dependency:
implementation 'software.amazon.lambda:powertools-serialization:1.17.0'
b) Use the extractDataFrom method to serialize the object, like this:
extractDataFrom(event).as(Product.class);
I just started a fresh project, and importing powertools-serialization:1.17.0 brings along com.fasterxml.jackson.core:jackson-databind:2.9.9

Now, when I try to use it with a valid request:

There is a problem with EventPart.as, as it uses this line:

But the method readValue(String sourceContent. Class valueClazz) is not available on version 2.9.9 of the Jackson ObjectMapper, so I end up getting a “NoSuchMethod” exception:

Now, if I manually update the version of Jackson-databind to 2.12, this works perfectly:
Possible Solution
Enforce the jackson-databind dependency (2.15.2) in the serialization module so that maven does not take the transitive one from jmespath (2.9.9)
Environment
The text was updated successfully, but these errors were encountered: