Defining request and response models

API Gateway provides a mechanism to model the incoming requests and outgoing responses and apply basic request validations.

It also provides a mechanism to transform these payloads into the integration requests/responses that are passed and returned from the downstream Lambda functions.

The models are defined using JSON Schema.

For example, for our Greeter API, the request that the API Gateway takes in is only a string. The JSON schema definition for such an entity is as follows. We have named it GreetingInput:

{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "string"
}