I am trying to deploy lambda function which is written in JAVA and API Gateway using Serverless framework. After deploying my service(lambda function) using node CLI, when I test API, it shows “no data” in response body. It is not showing expected output in API Gateway.
Even when I test lambda function, it shows expected output.My Lambda function is taking key,value (String,Integer) pair as input and returning integer as output.
This is serverless.yml:
service: newService
provider:
name: aws
runtime: java8
stage: QA
region: us-east-1
package:
artifact: target/hello-dev.jar
functions:
hello:
handler: com.serverless.Handler
events:
- http:
path: service
method: post
integration: lambda
response:
headers:
Content-Type: "'application/json'"
template: "$input.path('$.body')"