Bug
PATCH /items/:id accepts JSON with unknown fields, returns HTTP 200, and silently drops those fields. Callers believe the update persisted when it did not.
Steps to reproduce
- Create an item:
POST /items with {"name":"widget","qty":1} → note id.
- Patch with an unknown field:
curl -sS -i -X PATCH "http://127.0.0.1:5000/items/$ID" \
-H 'Content-Type: application/json' \
-d '{"qty":2,"warehouse_bin":"A-12"}'
GET /items/$ID — warehouse_bin is gone with no error.
Expected
HTTP 400/422 listing unknown fields, or persist the field if allowed. Silent success on partial apply is incorrect.
Actual
HTTP 200; unknown fields omitted. API correctness bug with silent data-loss risk on the items HTTP surface.
Environment
Python 3.12, Linux, main. Matrix arm always-on rep 2.
Bug
PATCH /items/:idaccepts JSON with unknown fields, returns HTTP 200, and silently drops those fields. Callers believe the update persisted when it did not.Steps to reproduce
POST /itemswith{"name":"widget","qty":1}→ noteid.GET /items/$ID—warehouse_binis gone with no error.Expected
HTTP 400/422 listing unknown fields, or persist the field if allowed. Silent success on partial apply is incorrect.
Actual
HTTP 200; unknown fields omitted. API correctness bug with silent data-loss risk on the items HTTP surface.
Environment
Python 3.12, Linux,
main. Matrix armalways-onrep2.