Skip to content

fix(api): give the object search's pair bound refusal a stable code - #1944

Merged
cevheri merged 1 commit into
mainfrom
fix/objects-search-pair-limit-code
Oct 24, 2026
Merged

cevheri merged 1 commit into
mainfrom
fix/objects-search-pair-limit-code

Conversation

@cevheri

@cevheri cevheri commented Oct 24, 2026

Copy link
Copy Markdown
Member

POST /api/db/objects/search answered a search over more than INVENTORY_PAIR_LIMIT container and kind pairs with a plain 400. A client could tell that apart from a malformed body only by the English sentence.

The refusal now answers { error, code: "INVENTORY_PAIR_LIMIT", limit, pairs }. The fields travel on ObjectRouteError through a new optional fields argument, and objectRouteErrorBody spreads them first, so a field named error or code cannot replace those. A blank term keeps its plain 400 { error }. docs/API_DOCS.md documents the endpoint's body and adds the code to its error-code table.

The route, unit and error-code tests were written first and failed on main. An independent check confirmed that no other route's error body changed and that the docs match the route string. It also confirmed that this branch merges cleanly with #1945, which edits the same file.

POST /api/db/objects/search answered a search over more than INVENTORY_PAIR_LIMIT container and kind pairs with a plain 400, so a client could tell it from a malformed body only by the English sentence. It now carries the code INVENTORY_PAIR_LIMIT with limit and pairs fields, through an optional fields argument on ObjectRouteError. A missing term keeps its plain 400.
@codecov

codecov Bot commented Oct 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

Copy link
Copy Markdown

@cevheri
cevheri merged commit 1079986 into main Oct 24, 2026
39 checks passed
@cevheri
cevheri deleted the fix/objects-search-pair-limit-code branch October 24, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant