Skip to content

GET commands with parameters fail with HTTP 400 (missing SuperJSON input envelope) #1

Description

@WilliamAGH

Every generated GET command that takes parameters fails with HTTP 400 — dokploy compose one --composeId <valid-id> --json returns "Request failed with status code 400". Parameterless GETs (project all) and all POST commands work, which is why this slipped through.

apiGet() sends the params as a bare JSON object (?input={"composeId":"..."} in src/client.ts), but the Dokploy server runs tRPC with the SuperJSON transformer, so input has to arrive as { "json": { ... } }. A bare object deserializes to undefined and the server rejects the call before the procedure runs; replaying the same request with input={"json":{"composeId":"..."}} returns 200. apiPost() already wraps its body this way, which is why writes work. 141 of the 223 GET operations in openapi.json take query parameters, and every generated GET command routes through apiGet().

Seen on @dokploy/cli 0.30.2 against Dokploy server v0.30.2; the same failure is reported upstream against 0.29.x servers (Dokploy/cli#39, #46, #48). #2 is the immediate, transitional fix — one line, works against every server version with the SuperJSON transformer, and identical to upstream PR #52. The bigger question is upstream PR #45 (building on #40): migrating the whole client off tRPC onto the server's REST surface. That's the strategic direction to weigh separately; if it ever lands, the envelope fix here becomes obsolete.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghigh priority - do nextImportant work to address next

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions