How to complete the challenge PUT /api/todos no id (422)

Issue a PUT request to /api/todos without an id in the URL or the request body.

The /api/todos endpoint exists, but the API cannot know which todo to update. Because the request reaches a valid endpoint but is missing required update information, the response should be 422 Unprocessable Content.

Basic Instructions

  • Send PUT /api/todos
  • Add an X-CHALLENGER header to track challenge completion
  • Set Content-Type to application/json
  • Do not include an id field in the JSON payload
  • Include a valid title so the missing identifier is the relevant error
  • Verify the response status is 422

Example body:

{
  "title": "missing identifier",
  "doneStatus": false,
  "description": "no id in URL or body"
}

Try it now

PUT /api/todos without an id in the URL or payload

Lessons Learned

  • PUT /api/todos without any id leaves the server unable to identify the resource to replace.
  • A full representation still needs a target identity for update semantics.
  • 422 Unprocessable Content can signal missing addressing information, not just bad field data.

Suggested Experiments

  • Add only the body id and compare this failure with the successful PUT /api/todos body-id challenge.
  • Send the same no-id payload to POST /api/todos and observe whether create semantics differ.
Experiment with this endpoint