Skip to content

Bug: PATCH /items/:id returns 200 but drops unknown fields without error #28

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 that the API should reject or store:
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/$IDqty may update, but warehouse_bin is gone with no error.

Expected

Either:

  • HTTP 400/422 with a clear validation error listing unknown fields, or
  • Persist warehouse_bin if the schema allows it.

Silent success on partial apply is incorrect for an HTTP API.

Actual

HTTP 200 with a body that omits warehouse_bin. No warning in logs. This is a correctness bug on the items HTTP API surface and risks data loss for clients integrating storage/warehouse metadata.

Environment

Python 3.12, Linux, main of this repo.

Why this matters for labeling

This is an API endpoint bug with high user impact (silent data loss). It is not a docs or storage-driver issue by itself — the failure is in request validation on the HTTP handler.

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

    area/apiAPI and HTTP endpoint issuesbugSomething isn't workingpr-openAn open PR already addresses this issuepriority/highHigh priorityready-to-code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions