apiGet sends params as ?input=<JSON> instead of named query params — all GET commands with parameters fail (400)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 85/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
Hướng nghiên cứu
Bắt đầu trong src/client.ts và so sánh apiGet với các quy ước về tham số truy vấn trong openapi.json. Chạy một lệnh có tham số như dokploy compose one --composeId <valid-id> --json, sau đó kiểm tra rằng các lệnh GET sử dụng các khóa truy vấn có tên và trả về thành công thay vì thất bại với trạng thái 400.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- TypeScript
- Star
- 152
- Fork
- 46
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Dokploy/cli
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 62/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Đang mởbug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Client support matrix inclusion Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
calcite-components needs triage refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Esri/calcite-design-system#15203 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
danielmiessler/LifeOS#2218 ·