I am using aws lambda authorizer with api gateway.My handler is written in Java, while returning IAM policy document I am getting json mapping exception , attaching the screenshot of logs from cloudwatch , I have also logged the handler response pojo you can check in the screenshot.
However , If I test lambda output it is giving correct json as expected but it is breaking when I hit the same function through api gateway , Please suggest , any help would be appreciated.
{
"policyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Action": "execute-api:Invoke",
"Effect": "Allow",
"Resource": "arn:aws:execute-api:us-east-1:304262502320:uz4gxmilu8/Test/GET/*"
}
]
},
"context": {
"sub": "auth"
}
}