Bird
0
0

Given this request mapping template:

medium📝 Predict Output Q13 of 15
AWS - API Gateway
Given this request mapping template:
{
  "user": "$input.path('$.username')",
  "id": "$input.path('$.userId')"
}

What will be the transformed request if the client sends:
{"username": "alice", "userId": "123"}
A{"user": "$.username", "id": "$.userId"}
B{"username": "alice", "userId": "123"}
C{"user": "alice", "id": "123"}
D{"user": null, "id": null}
Step-by-Step Solution
Solution:
  1. Step 1: Understand the mapping template fields

    The template maps user to $.username and id to $.userId.
  2. Step 2: Apply the client JSON values

    Client sends username as "alice" and userId as "123", so these replace the template placeholders.
  3. Final Answer:

    {"user": "alice", "id": "123"} -> Option C
  4. Quick Check:

    Template fields replaced by client values [OK]
Quick Trick: Mapping replaces template fields with client JSON values [OK]
Common Mistakes:
  • Confusing template keys with client keys
  • Leaving placeholders as literal strings
  • Assuming null values when fields exist

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes