How it works...

In this recipe, we used mapping templates with the variable $input that is provided by API gateway to transform the request JSON and response JSON. We also specified the recommended passthrough behavior of WHEN_NO_TEMPLATES, instead of the default WHEN_NO_MATCH. We discussed passthrough behavior in the previous recipe.