Skip to main content
← Back to list
01Issue
BugShippedExtensions
Assigneesstack72

Relationships

#1322 gcp/sheets spreadsheets-values: batch_get crashes with "Request with GET/HEAD method cannot have body"

Opened by ryan_0zxv · 7/21/2026· Shipped 7/21/2026

Summary: In @swamp/gcp/sheets 2026.07.21.1, the batch_get method on spreadsheets-values fails before reaching the API. The method passes an empty object {} as the request body to createResource, whose fetch call serializes any truthy body (body: body ? JSON.stringify(body) : undefined, _lib/gcp.ts:436). batch_get declares httpMethod: "GET" (spreadsheets_values.ts:603), and fetch rejects a GET request carrying a body.

Environment: swamp 20260719.230301.0-sha.1f316154, @swamp/gcp/sheets 2026.07.21.1, macOS (darwin arm64), service-account credentials via credentialsJson.

Reproduction (any spreadsheet readable by the credentials):

$ swamp model create @swamp/gcp/sheets/spreadsheets-values demo \
    --global-arg name=demo --global-arg spreadsheetId=<ID> \
    --global-arg credentialsJson=<SA JSON>
$ swamp model method run demo batch_get
[FTL] error: Error: "Request with GET/HEAD method cannot have body"

Control — the get method on the same model, same credentials, succeeds:

$ swamp model method run demo get --input identifier='Sheet1!A1:B2'
[INF] Method "get" completed on "demo"

Actual: batch_get always throws Request with GET/HEAD method cannot have body; the request never leaves the client.

Expected: batch_get issues GET v4/spreadsheets/{spreadsheetId}/values:batchGet with no body, returning a BatchGetValuesResponse.

Suggested resolution:

  • Pass undefined instead of {} as the body for GET-method resources in batch_get (spreadsheets_values.ts:614), or
  • Guard in createResource: skip body serialization when httpMethod is GET/HEAD.

(Possibly related while in there: batch_get exposes no way to supply the ranges query parameter even though the Discovery spec lists it — may be by-design via global args, mentioning in case it's the same code path.)

Upstream repository: https://github.com/swamp-club/swamp-extensions

Environment

  • Extension: @swamp/gcp/sheets@2026.07.21.1
  • swamp: 20260719.230301.0-sha.1f316154
  • OS: darwin (aarch64)
  • Deno: 2.8.3
  • Shell: /bin/zsh
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 4 MOREPR_MERGED+ 1 MORECONTRIBUTOR_NOTIFIED

Shipped

7/21/2026, 5:26:22 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack727/21/2026, 4:02:03 PM
Editable. Press Enter to edit.

stack72 commented 7/21/2026, 5:26:30 PM

Thanks @ryan_0zxv for reporting this! The fix has been merged and a release is on its way. We appreciate your contribution to swamp.

Sign in to post a ripple.