Fix close-position request body#298
Merged
Merged
Conversation
The close-position endpoint identifies the position in the URL path. Sending position_id again in the JSON body now fails against the backend's deny-unknown-fields request schema, so the SDK only sends close parameters in the body.
Constraint: Backend expects /api/v1/positions/{position_id}/close with close_type payload only
Rejected: Loosen backend JSON parsing | would hide stale client contracts instead of fixing SDK request shape
Confidence: high
Scope-risk: narrow
Directive: Keep resource IDs in path-only bodies out of SDK JSON payloads unless the backend contract explicitly requires duplication
Tested: bun test packages/core/tests/unit/api/positions.test.ts; bun run check
🦋 Changeset detectedLatest commit: 1fd5d17 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The close-position SDK fix changes the published @0xmonaco/core package behavior, so it needs a patch changeset for the release pipeline. Constraint: Changesets bot requires package-impact metadata for SDK release PRs Confidence: high Scope-risk: narrow Tested: bun test packages/core/tests/unit/api/positions.test.ts Tested: bun run check Not-tested: Full package publish pipeline
ian-monaco
commented
Apr 22, 2026
Contributor
Author
ian-monaco
left a comment
There was a problem hiding this comment.
Review pass: no issues found in the close-position SDK contract change. The request now keeps position_id path-only, the unit test locks that body shape, and the added changeset covers the @0xmonaco/core patch release. Local verification: bun test packages/core/tests/unit/api/positions.test.ts; bun run check.
codebycarson
approved these changes
Apr 23, 2026
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.
Summary
position_idfrom the close-position JSON payload/api/v1/positions/{position_id}/closeVerification
bun test packages/core/tests/unit/api/positions.test.tsbun run check