January 2019
Intermediate to advanced
490 pages
15h 37m
English
You can map the requests and responses in API Gateway by using API Gateway's body mapping templates, based on the Apache VTL and JSONPath expressions.
The $input variable provided by the API Gateway represents the input payload (a request payload or response payload, based on the case) and the parameters available to the template. The function $input.json() retrieves part of the JSON, as specified by a JSONPath expression. In JSONPath, $ represents the outer-level JSON object. $input.json('$.user.name') returns the value of the field name within the user object, and $input.json('$.greeting.time') returns the value of the field time within the greeting object. Similarly, $input.json('$.message') returns the ...
Read now
Unlock full access