Skip to content

Validate task status query parameter#487

Merged
utksh1 merged 5 commits into
utksh1:mainfrom
HitanshiThakar:fix/task-status-validation
Jun 4, 2026
Merged

Validate task status query parameter#487
utksh1 merged 5 commits into
utksh1:mainfrom
HitanshiThakar:fix/task-status-validation

Conversation

@HitanshiThakar
Copy link
Copy Markdown
Contributor

Description

Added validation for the optional status query parameter in GET /api/v1/tasks.

Previously, invalid status values returned an empty result set. The endpoint now validates the value against the supported TaskStatus enum values and returns a structured 400 Bad Request response for invalid inputs.

Also added tests covering both valid and invalid status filters.

Related Issues

Closes #467

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

pytest testing/backend/test_task_pagination.py
Result:
12 test passed

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

@utksh1 utksh1 added level:intermediate 35 pts difficulty label for moderate contributor PRs type:bug Bug fix work category bonus label type:testing Testing work category bonus label area:backend Backend API, database, or service work gssoc:approved Admin validation: approved for GSSoC scoring labels Jun 4, 2026
Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The status query parameter is validated against TaskStatus and invalid values return a clear 400 response with test coverage. CI is passing.

@utksh1 utksh1 merged commit 61ad823 into utksh1:main Jun 4, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend Backend API, database, or service work gssoc:approved Admin validation: approved for GSSoC scoring level:intermediate 35 pts difficulty label for moderate contributor PRs type:bug Bug fix work category bonus label type:testing Testing work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BACKEND] Validate task status filter values on list endpoint

2 participants