WorkItemDetail.labels validation fails when API returns unexpanded label IDs
Maintainer thường phản hồi trong vòng 5 ngày
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
- 68/100
Hướng nghiên cứu
Tìm model WorkItemDetail trong SDK và tái hiện lỗi thông qua work_items.retrieve mà không có expand=labels. Xác minh rằng labels chấp nhận cả các chuỗi ID label chưa được mở rộng của API lẫn các đối tượng Label đã được mở rộng, đồng thời xác nhận rằng các đường dẫn retrieve_work_item không còn gây ra ValidationError.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
work_items.retrieve() (and any code path returning a WorkItemDetail) raises a pydantic.ValidationError for any work item that has labels attached, when labels is not explicitly expanded.
Repro
Call the retrieve endpoint for a work item that has one or more labels, without expand=labels:
client.work_items.retrieve(
workspace_slug=workspace_slug,
project_id=project_id,
work_item_id=work_item_id,
)
Result: pydantic.ValidationError — Input should be a valid dictionary or instance of Label — deterministic, not intermittent, for every work item that has labels.
Root cause
The Plane API returns labels as an array of label ID strings when the field isn't expanded (the normal/default response shape). The WorkItemDetail model types labels as list[Label] unconditionally, so pydantic rejects the plain ID strings instead of accepting either shape.
Expected behavior
labels should accept both shapes depending on whether the caller expanded it — e.g. list[Label] | list[str], or the model should coerce string IDs into a minimal Label reference, consistent with how the API actually behaves when expand isn't requested.
Environment
plane-sdk==0.2.19(PyPI)- Found via
makeplane/plane-mcp-server(retrieve_work_item/retrieve_work_item_by_identifiertools), but the bug is in the SDK's model, not the MCP server. - Server tested against: self-hosted Plane Community 1.3.1.
Workaround in use
Using list_work_items (which doesn't hit this validation path) instead of retrieve_work_item*, and filtering client-side.
- Ngôn ngữ chính
- Python
- Star
- 18
- Fork
- 30
- Merge trung bình
- 5 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 makeplane/plane-python-sdk
-
[bug]: update() strips None values via exclude_none=True, making it impossible to clear nullable fieldsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
makeplane/plane-python-sdk#35 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
fix: WorkItemAttachments.create() raises ValidationError on actual Plane responseCó thể đã có người làm @volodchenkov đã nhận 207 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
makeplane/plane-python-sdk#33 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
makeplane/plane-python-sdk#21 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
makeplane/plane-python-sdk#20 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Pydantic Error on Work ItemĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
makeplane/plane-python-sdk#15 ·
Maintainer thường phản hồi trong vòng 5 ngày
Tất cả issue của makeplane/plane-python-sdk
Issue tương tự
-
bug harness
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
mruangutai/harness#2687 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
modal-labs/modal-client#4158 ·
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 72/100
The-Swarm-Corporation/swarms-rs#168 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] SMTP listener now binds to EMAIL_PORT instead of 2525 since the gunicorn switch 5.0.3-ls373Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
linuxserver/docker-healthchecks#137 · 1 bình luận ·