AWS Certified Developer – Associate — Question 343

A developer is exposing an API by using Amazon API Gateway and AWS Lambda as the backend for an application. The developer wants to add validation rules for a POST method to ensure that the data from the frontend web form is valid. The validation rules must include mandatory fields, data type, length, and regular expressions.

Which solution will meet these requirements?

Answer options

Correct answer: A

Explanation

To validate the structure and content of a POST request body in Amazon API Gateway, you must define a model using JSON Schema, which supports constraints like mandatory fields, data types, length, and regular expressions. Options B, C, and D are incorrect because headers, query strings, and path parameters cannot be used to validate complex payload bodies with these specific rules.