Repository navigation
fix(api): give the object search's pair bound refusal a stable code - #1944
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



POST /api/db/objects/searchanswered a search over more thanINVENTORY_PAIR_LIMITcontainer 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 onObjectRouteErrorthrough a new optionalfieldsargument, andobjectRouteErrorBodyspreads them first, so a field namederrororcodecannot 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.