Hello friends, I have a question. How can I add re...
# help
s
Hello friends, I have a question. How can I add request and response mapping templates ?
f
Hey @Sachin Titus, you’d need to use the
sst.ApiGatewayV1Api
construct as mapping templates are only available for API Gateway REST API.
You can specify the mapping templates by doing something like this:
Copy code
new ApiGatewayV1Api(this, "Api", {
  routes: {
    "GET /notes": {
      function: "src/list.main",
      integrationOptions: {
        requestTemplates: ...,
      }
    },
  },
});
More examples on the
integraion
options here - https://docs.aws.amazon.com/cdk/api/latest/docs/aws-apigateway-readme.html#working-with-models