Skip to content

Add pagination and filtering to GET /tasks/ #2

Description

@sonnymay

Summary

The current GET /tasks/ endpoint returns all tasks in a single response. Adding pagination and filtering makes this a more realistic, production-grade API.

Acceptance criteria

  • GET /tasks/?skip=0&limit=20 — offset-based pagination with configurable defaults
  • GET /tasks/?status=completed — filter by completion status
  • GET /tasks/?q=keyword — optional keyword search on task title
  • Response includes total, skip, limit, and items fields (envelope pattern)
  • Pydantic response schema updated to reflect the paginated envelope
  • Existing tests updated; new tests cover pagination edge cases (empty page, last page)

Notes

This mirrors real-world API patterns used in production FastAPI services and is a common interview topic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions