Empty name over the API
Compare the status: 422 after, 201 before
Take over this scene live
confidence takeover /private/tmp/confidence-demo/home/reports/shopping-list/count-items-d8d7493 1
confidence takeover /private/tmp/confidence-demo/home/reports/shopping-list/count-items-d8d7493 1 --step
Before · base main 04da7e2
After · head d8d7493
-
1 Post an empty name 201 Created changed to 422 Unprocessable Entity1 check ✗ changed to ✓1 new check on headcontent-type: application/json
{ "name": ""}
Before · base
{ "id": 1,
"name": ""} After · head
{ "error": "name is required"}
Checks base head Comment Answers 422 failed on base, expected before the fix passed Body names the error — passed -
2 Stored items only recorded on head
Before · base
Not recorded on base
After · head
SELECT id,name FROM items (no rows)
Checks base head Comment No item stored — passed
shopping-list· count-items· vs main
The list shows how many items it holds and refuses empty names
The list did not say how many items it held, and an empty name, over the API or in the form, was stored as a blank item. Now the page shows the count, the API answers 422 to an empty name and the form skips it. A number sent as the name over the API gets no answer.