Courseiva
Development with AWS ServicesmediumMultiple ChoiceObjective-mapped

DVA-C02 Development with AWS Services Practice Question

A developer is building a REST API using Amazon API Gateway and wants to validate the incoming request body against a JSON schema before passing the request to the backend Lambda function. Which API Gateway feature should the developer use?

⚠ Common exam trap

Test-takers frequently confuse request validation with mapping templates, assuming that mapping templates can validate the request body, but mapping templates only transform data and do not enforce schema constraints.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Request validation

API Gateway's request validation feature allows you to define a JSON schema (using JSON Schema Draft 4) for the request body and automatically reject requests that do not conform before they reach the backend. This offloads validation from the Lambda function, reducing cold start overhead and ensuring only valid payloads are processed. The developer can configure this in the API Gateway console or via the OpenAPI specification.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Request validation

    Why this is correct

    Amazon API Gateway's request validation feature allows developers to define a JSON schema for the request body, as well as specify required headers, query string parameters, and path parameters. This mechanism ensures that incoming requests conform to the API's expected structure and data types before they reach the backend integration. By rejecting malformed requests early, it enhances API security and reduces unnecessary processing by downstream services.

  • Mapping templates

    Why it's wrong here

    Mapping templates, written in Apache Velocity Template Language (VTL), are used to transform the format of request payloads before sending them to the backend integration, or to transform backend responses before sending them back to the client. While they can manipulate data, their primary function is data transformation and enrichment, not to enforce structural or semantic validation rules against an API schema. They operate on data that has already passed (or bypassed) any validation steps.

  • Integration request

    Why it's wrong here

    The integration request configuration within API Gateway defines how the gateway communicates with the backend endpoint, such as an AWS Lambda function, HTTP endpoint, or other AWS service. It specifies the integration type, HTTP method, URI, credentials, and timeout settings for the backend call. This configuration is solely focused on establishing the connection and parameters for the backend interaction, not on validating the client's initial request payload or parameters.

  • Stage variables

    Why it's wrong here

    Stage variables are named key-value pairs that you define for each deployment stage of an API Gateway API, allowing you to pass environment-specific configuration values. These variables can be referenced in mapping templates, integration requests, or authorizers to dynamically configure backend endpoints, database table names, or other operational parameters. They serve as configuration placeholders and do not possess any inherent capability to validate the structure or content of incoming client requests.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

This DVA-C02 question is part of Courseiva's 724-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.