Skip to content

fix: return project_id in ReadTaskInProject schema - #16

Merged
SrStamm merged 2 commits into
mainfrom
fix/read-task-in-project-project-id
Oct 16, 2026
Merged

SrStamm merged 2 commits into
mainfrom
fix/read-task-in-project-project-id

Conversation

@SrStamm

@SrStamm SrStamm commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • GET /task/{project_id} no longer drops project_id from each task in the response.
  • Root cause was serialization-side only: get_all_task_to_project already returns full Task entities that include project_id, but ReadTaskInProject never declared the field, so Pydantic discarded it during response validation.
  • The router test had the same blind spot — it asserted every other key but not project_id, so CI stayed green while the field was missing.

Changes

File Change
models/schemas.py Added project_id: int to ReadTaskInProject
test/test_routers/test_task.py test_get_task_in_project now asserts project_id is present in every task

Test plan

  • pytest test/test_routers/test_task.py::test_get_task_in_project passes locally (test body green; fixture teardown needs Redis, which CI provides as a service)
  • Ran the same suite against the parent commit: identical result (3 failed / 6 passed / 4 errors), confirming those failures are pre-existing and Redis-related, not introduced by this change
  • CI CI - Lint & Test green on this PR

@SrStamm SrStamm added the bug Something isn't working label Oct 16, 2026
@SrStamm
SrStamm merged commit f4de98d into main Oct 16, 2026
1 check passed
@SrStamm
SrStamm deleted the fix/read-task-in-project-project-id branch October 16, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant