Skip to content

[matrix always-on r2] Bug: PATCH /items/:id silently drops unknown fields #30

Description

@ascerra

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

  1. Create an item: POST /items with {"name":"widget","qty":1} → note id.
  2. 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"}'
  1. GET /items/$IDwarehouse_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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions