API Gateway fronts a grant-application API. Invalid ZIP codes and missing required fields currently reach Lambda and clutter logs. Where should developers enforce request validation first?
Select an answer to reveal the explanation.
Short Explanation
Stop bad ZIP codes at the front desk — API Gateway — before they wander into Lambda and trash the log book. Request models and validators catch missing fields early. Business code should see clean input.
Full Explanation
API Gateway can enforce JSON Schema-style request validation and required parameters before integration invocation, reducing noise and cost in Lambda. Logging after the fact or cleaning up overnight still wastes compute and stores bad data. Removing the gateway eliminates the natural edge validation point. Developers should still validate deeply in code, but schema checks belong at the API layer first.