diff --git a/api/openapi.yaml b/api/openapi.yaml index 69bd090..6d1a4a6 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.1.0 info: title: TaskForge API - version: 1.0.0 + version: 2.0.0 paths: /api/tasks: get: @@ -81,26 +81,6 @@ paths: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' - delete: - summary: Delete Task - description: Delete a task by ID. - operationId: delete_task_api_tasks__task_id__delete - parameters: - - name: task_id - in: path - required: true - schema: - type: integer - title: Task Id - responses: - '204': - description: Successful Response - '422': - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' /api/health: get: summary: Health @@ -140,19 +120,23 @@ components: type: string title: Status default: pending + priority: + type: string + title: Priority created_at: type: string format: date-time title: Created At - assignee: + assigned_to: anyOf: - type: string - type: 'null' - title: Assignee + title: Assigned To type: object required: - id - title + - priority - created_at title: Task TaskCreate: @@ -165,14 +149,18 @@ components: - type: string - type: 'null' title: Description - assignee: + priority: + type: string + title: Priority + assigned_to: anyOf: - type: string - type: 'null' - title: Assignee + title: Assigned To type: object required: - title + - priority title: TaskCreate ValidationError: properties: diff --git a/app/main.py b/app/main.py index 34fe5dd..ead9f3b 100644 --- a/app/main.py +++ b/app/main.py @@ -3,7 +3,7 @@ from typing import Optional from datetime import datetime -app = FastAPI(title="TaskForge API", version="1.0.0") +app = FastAPI(title="TaskForge API", version="2.0.0") class Task(BaseModel): @@ -11,14 +11,16 @@ class Task(BaseModel): title: str description: Optional[str] = None status: str = "pending" + priority: str created_at: datetime - assignee: Optional[str] = None + assigned_to: Optional[str] = None class TaskCreate(BaseModel): title: str description: Optional[str] = None - assignee: Optional[str] = None + priority: str + assigned_to: Optional[str] = None tasks_db = {} @@ -55,15 +57,10 @@ def get_task(task_id: int): return tasks_db[task_id] -@app.delete("/api/tasks/{task_id}", status_code=204) -def delete_task(task_id: int): - """Delete a task by ID.""" - if task_id not in tasks_db: - raise HTTPException(status_code=404, detail="Task not found") - del tasks_db[task_id] +# DELETE endpoint removed @app.get("/api/health") def health(): """Health check endpoint.""" - return {"status": "healthy", "version": "1.0.0", "uptime": 42} + return {"status": "healthy", "version": "2.0.0", "uptime": "42 seconds"}