apiGet sends params as ?input=<JSON> instead of named query params — all GET commands with parameters fail (400)
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 85/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
src/client.ts から始め、apiGet と openapi.json のクエリパラメーターの規則を比較します。dokploy compose one --composeId <valid-id> --json のようなパラメーター付きコマンドを実行し、その後、GET コマンドが名前付きのクエリキーを使用して成功することを確認します。ステータス 400 で失敗してはいけません。
索引モデルが issue の本文から書いたものです。
説明
Problem
Any CLI command that maps to a GET endpoint with query parameters fails:
dokploy compose one --composeId <valid-id> --json
# Request failed with status code 400
This affects every "read one" / "search" style command across the API (compose one, application one, project one, mysql one, registry one, *.search, *.readLogs, etc. — anything backed by a GET with query params in openapi.json). Commands backed by POST (deploy, delete, update, create) are unaffected.
Root cause
In src/client.ts:
export async function apiGet(
endpoint: string,
params?: Record<string, unknown>,
) {
const client = createClient();
const query = params
? `?input=${encodeURIComponent(JSON.stringify(params))}`
: "";
const response = await client.get(`/trpc/${endpoint}${query}`);
return response.data?.result?.data?.json ?? response.data;
}
This wraps all params into one JSON-encoded input query string — the convention for calling tRPC procedures directly. But the REST surface this CLI actually targets (per its own openapi.json) expects each parameter as its own named query key, e.g. ?composeId=<id>, not a JSON blob under input.
Confirmed directly: the same request, same auth, sent as a plain named query param instead of through the CLI, succeeds:
curl -s -H "x-api-key: $DOKPLOY_AUTH_TOKEN" \
"https://<host>/api/compose.one?composeId=<valid-id>"
# returns the full object correctly
Suggested fix
const response = await client.get(`/trpc/${endpoint}`, { params });
Environment
@dokploy/cli 0.29.14 (also reproduced on 0.3.0 — not version-specific).
- 主要言語
- TypeScript
- スター
- 152
- フォーク
- 46
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Dokploy/cli のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 62/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
calcite-components needs triage refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Esri/calcite-design-system#15203 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
fullcalendar/fullcalendar#8106 ·