WorkItemDetail.labels validation fails when API returns unexpanded label IDs
Los mantenedores suelen responder en 5 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
Línea de trabajo
Encuentra el modelo WorkItemDetail en el SDK y reproduce el fallo mediante work_items.retrieve sin expand=labels. Verifica que labels acepte tanto las cadenas de ID de label no expandidas de la API como los objetos Label expandidos, y confirma que las rutas retrieve_work_item ya no generen ValidationError.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 18
- Forks
- 30
- Merge medio
- 5 d 6 h
- PR fusionados (30 d)
- 7
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de makeplane/plane-python-sdk
-
[bug]: update() strips None values via exclude_none=True, making it impossible to clear nullable fieldsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
makeplane/plane-python-sdk#35 ·
Los mantenedores suelen responder en 5 días
-
fix: WorkItemAttachments.create() raises ValidationError on actual Plane responsePosiblemente ocupada @volodchenkov la tomó hace 207 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
makeplane/plane-python-sdk#33 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
makeplane/plane-python-sdk#21 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
makeplane/plane-python-sdk#20 ·
Los mantenedores suelen responder en 5 días
-
Pydantic Error on Work ItemAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
makeplane/plane-python-sdk#15 ·
Los mantenedores suelen responder en 5 días
Todos los issues de makeplane/plane-python-sdk
Issues similares
-
bug harness
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
mruangutai/harness#2687 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
modal-labs/modal-client#4158 ·
-
good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Medio día Aptitud para principiantes 72/100
The-Swarm-Corporation/swarms-rs#168 ·
Los mantenedores suelen responder en 1 día
-
[BUG] SMTP listener now binds to EMAIL_PORT instead of 2525 since the gunicorn switch 5.0.3-ls373Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
linuxserver/docker-healthchecks#137 · 1 comentario ·