-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The date filter (startDate / endDate) doesn't work when passed as query parameters. The API returns a Zod validation error expecting date type but receiving string.
Steps to Reproduce
- Start taskiq-admin
- Create some tasks
- Try to filter by date via URL:
http://localhost:3000/tasks?page=1&perPage=20&search=test&startDate=2026-01-19&endDate=2026-01-21
Expected Behavior
Tasks filtered by date range should be returned.
Actual Behavior
API returns validation error:
{
"error": true,
"statusCode": 400,
"statusMessage": "Validation Error",
"message": "[{\"expected\":\"date\",\"code\":\"invalid_type\",\"path\":[\"startDate\"],\"message\":\"Invalid input: expected date, received string\"}]"
}Analysis
Query string parameters are always strings. Zod schema expects JavaScript Date object which is impossible to pass via URL. The schema should coerce string to Date:
// Current (broken)
startDate: z.date().optional()
// Should be
startDate: z.coerce.date().optional()Environment
- taskiq-admin version: 1.8.1
- Docker image:
ghcr.io/taskiq-python/taskiq-admin:1.8.1
Metadata
Metadata
Assignees
Labels
No labels