CodeEvaluator / example_big_project /question_objective.txt
DhyandevP's picture
chore: Apply Ponytail audit fixes and code cleanup
a963267
Raw History Blame Contribute Delete
985 Bytes
Problem: Build a Flask REST API for managing a Task List (To-Do list). The project must be structured across multiple files.
Input: HTTP JSON requests to the following endpoints:
- GET /tasks : Retrieve all tasks.
- POST /tasks : Create a new task. Request body should be JSON: {"title": "Task title", "description": "Task description"}.
- PUT /tasks/<task_id>/complete : Mark a task as completed.
Output: JSON responses containing the task objects and appropriate HTTP status codes (200 for success, 201 for creation, 400 for bad request, 404 for not found).
Constraints: The application must use a modular structure (e.g., separate routing and business logic into different files like `main.py` and `utils.py`). Data can be stored in-memory using a Python list or dictionary.
Edge Cases to Check:
1. Missing "title" in the POST request body (must return 400 Bad Request).
2. Attempting to complete a task (PUT) with an invalid or non-existent `task_id` (must return 404 Not Found).