How to complete the challenge POST /api/todos (422) title too long

Issue a POST request to /api/todos with a title longer than the maximum allowed length.

{
  "title": "this title has far too many characters to validate.",
  "doneStatus": true,
  "description": "should trigger a 422 error"
}

The response should be 422 Unprocessable Content.

{
  "errorMessages": [
    "Failed Validation: Maximum allowable length exceeded for title - maximum allowed is 50"
  ]
}

Try it now

POST /api/todos with a long title to trigger 422

Lessons Learned

  • title has its own maximum length and should be tested separately from description.
  • A field-length error should not depend on the rest of the payload being unusual.
  • Title boundaries matter because titles are required and visible in collection summaries.

Suggested Experiments

  • Compare a 50 character title with a 51 character title while keeping description short.
  • Test an empty title separately to distinguish missing or blank validation from length validation.
Experiment with this endpoint