Skip to content

[m-baseline-r2-3ed21b74] PATCH /items silent drop unknown fields #38

Description

@ascerra

Bug (baseline rep 2 token 3ed21b74)

PATCH /items/:id returns HTTP 200 while silently dropping unknown JSON fields (e.g. warehouse_bin_3ed21b74).

Reproduce

ID=$(curl -sS -X POST http://127.0.0.1:5000/items -H 'Content-Type: application/json' -d '{"name":"w-3ed21b74","qty":1}' | jq -r .id)
curl -sS -i -X PATCH http://127.0.0.1:5000/items/$ID -H 'Content-Type: application/json' -d '{"qty":2,"warehouse_bin_3ed21b74":"A-12"}'
curl -sS http://127.0.0.1:5000/items/$ID

Expected

400/422 for unknown fields, or persist them.

Actual

200 with field omitted — API data-loss bug on items endpoint.

Environment

Python 3.12, Linux, main. Unique matrix token 3ed21b74.

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