How to complete the challenge POST /api/todos (422) description too long
Issue a POST request to /api/todos with a description longer than the maximum allowed length.
The response should be 422 Unprocessable Content and include a validation error explaining that the description exceeded the maximum length.
Keep the JSON syntax valid; the point of the challenge is entity validation, not malformed JSON.
Try it now
POST /api/todos with a long description to trigger 422
Lessons Learned
- A readable
JSONbody can still fail whendescriptionexceeds its field limit. - Field-specific validation should point to the oversized
description, not a generic parse problem. - This boundary differs from the whole-request
413 Content Too Largesize limit.
Suggested Experiments
- Send
200description characters, then201, and compare success with422 Unprocessable Content. - Keep
descriptioninvalid while changingtitleto prove the reported error stays focused.