user5884533
user5884533

Reputation:

Export Body Mapping Template in AWS API Gateway

I have created an AWS API Gateway resource with a GET method that triggers a Lambda. In the Body Mapping Template I have defined a custom mapping.

I created this in the web based interface. I want to use YAML files instead, so I can edit the API Gateway through code. So I went to the Export tab and exported it to YAML.

I see that a lot of properties came down in the yaml file, but the Body Mapping Template is not there. How or where do I get that part to be in a local code file that can be committed to my source code repo, as well as edited locally?

Upvotes: 2

Views: 782

Answers (1)

Abhigna Nagaraja
Abhigna Nagaraja

Reputation: 1894

You need to use "Export as Swagger + API Gateway integrations". You will see the api gateway extension x-amazon-apigateway-integration.requestTemplates which has the defined body mapping template.

Upvotes: 2

Related Questions