Case File: Never Trust the Body
Accept new parcels with POST /parcels, validate the JSON body before it goes anywhere near the data, and answer 400 naming every wrong field, in alphabetical order, whether the body was missing a field, wrong, not JSON or not an object. Real Request objects drive your handler. Real TypeScript, generated for you alone.
Case File: Never Trust the Body
Accept new parcels with POST /parcels, validate the JSON body before it goes anywhere near the data, and answer 400 naming every wrong field, in alphabetical order, whether the body was missing a field, wrong, not JSON or not an object. Real Request objects drive your handler. Real TypeScript, generated for you alone.
In this lesson:
- typescript
- api
- validation
- post
- json
- status-codes
- security
- case-file
This lesson is part of a paid plan
Upgrade to Pro to unlock this course, its labs and its exam.
View Pricing Plans