Integrate an API with lambda - Part 3

Let us look at request validation features in API gateway
when user requests for an end point (resource) we could perform few validations before processing the request. For example, the end point might require one or more of the below fields

  • query parameters
  • path parameters
  •  header
  • body
API gateway provides validation for these fields.

There are multiple options available here. Default is none. Validate body is used if the request has a payload and that needs to be schema validated before processing. We could also use the option that validates for required query string parameters and headers. Names for the parameter that are applicable can be provided in the section as shown below


If the parameters need to be part of the cache we need to enable caching so that parameter becomes part of the cache key. Also the request body section will need the name of the model and the content type of the body. We need to create models in the section below first and then refresh the above section to select the required model.



Comments

Popular posts from this blog

Integrate an API with lambda - Part 5

Custom authorizer