AWS Lambda json deserialization with jackson annotations

后端 未结 5 1697
生来不讨喜
生来不讨喜 2021-01-07 22:43

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

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-07 23:26

    Take a look at this quote from AWS documentation:

    You shouldn't rely on any other features of serialization frameworks such as annotations. If you need to customize the serialization behavior, you can use the raw byte stream to use your own serialization.

    From: https://docs.aws.amazon.com/lambda/latest/dg/java-programming-model-req-resp.html

提交回复
热议问题