Created Java authorizer lambda to validate token. When I deploy aws jar works as expected, getting iampolicy as response. When Created native image using graalvm to minimize cold start time the response is changed to APIGatewayProxyResponseEvent. Got to know from API gateway logs getting below exception
Execution failed due to configuration error: Invalid JSON in response: Unrecognized field "isBase64Encoded" , not marked as ignorable
As it is expecting iampolicy as a response from authorizer instead it got below response.
{
"isBase64Encoded": false,
"headers": {
"date": "Tue, 09 Aug 2022 10:53:00 GMT",
"transfer-encoding": "chunked",
"lambda-runtime-trace-id": "",
"aws-api-gateway": "true",
"lambda-runtime-aws-request-id": "99b3-c10da8d41cfb",
"id": "339781a6-535f-dc19-e079-f32ae48a742c",
"contentType": "application/json",
"lambda-runtime-invoked-function-arn": "arn",
"lambda-runtime-deadline-ms": "1660042443373",
"timestamp": "1660042380735"
},
"body": "{\"principalId\":\"principleId\",\"policyDocument\":{\"Version\":\"2012-10-17\",\"Statement\":[{\"Action\":\"execute-api:Invoke\",\"Effect\":\"Allow\",\"Resource\":\"arn:resource\"}]},\"context\":{\"sub\":\"SamplecontextObject\"}}",
"statusCode": 200
}
Please any input/suggestion will be helpful