In this recipe, we will add validation to request payloads by using models. We will define a model by using the JSON schema draft language, and we will then use it to validate our payloads. We will use the same Lambda that we used in the recipe Building your first API with Lambda integration.
Validating request payloads with models
Getting ready
You need an active AWS account. You need to follow the section Getting started in the recipes Your first AWS Lambda and Your first Lambda with AWS CLI from Chapter 1, Getting Started with Serverless Computing on AWS to set up Java, Maven, the parent project, serverless-cookbook-parent-aws-java, and AWS CLI, and may also read other notes there including code usage guidelines, S3 bucket...