codeHysteria28 / codeHysteria28/copilot-agentic-demo
Add search and pagination to GET /tasks endpoint
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Description
The GET /tasks endpoint currently returns all tasks. We need search
functionality and pagination for production readiness.
## Requirements
- [ ] Add `q` query parameter to search tasks by title (case-insensitive substring match)
- [ ] Add `skip` (default: 0) and `limit` (default: 20, max: 100) query parameters
- [ ] Return a paginated response model: `{ items: Task[], total: int, skip: int, limit: int }`
- [ ] Validate that `limit` does not exceed 100
- [ ] Maintain backward compatibility — existing calls without params still work
## Acceptance Criteria
- `GET /tasks?q=deploy` returns only tasks with "deploy" in the title
- `GET /tasks?skip=0&limit=5` returns first 5 tasks with total count
- `GET /tasks?limit=200` returns 422 with validation error
- `GET /tasks` (no params) returns first 20 tasks (backward compatible)
## Files likely affected
- `src/app/models.py` — New PaginatedResponse model
- `src/app/store.py` — Add search and pagination to list method
- `src/app/routes.py` — Update GET /tasks endpoint
- `tests/test_tasks.py` — Add tests for search and pagination
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.