Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 77 additions & 6 deletions todo-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@

## **Requests**

| Route | Description |
| :------------------------------------------: | :-------------------------------: |
| [GET /v1/tasks](#get-v1tasks) | Return all tasks with pagination |
| [POST /v1/tasks](#post-v1tasks) | Creates new task |
| [GET /v1/health](#get-v1health) | Health check endpoint |
| [GET /v1/tasks/{taskId}](#get-v1taskstaskid) | Retrieves a single task by its ID |
| Route | Description |
| :------------------------------------------------: | :-------------------------------: |
| [GET /v1/tasks](#get-v1tasks) | Return all tasks with pagination |
| [POST /v1/tasks](#post-v1tasks) | Creates new task |
| [GET /v1/health](#get-v1health) | Health check endpoint |
| [GET /v1/tasks/{taskId}](#get-v1taskstaskid) | Retrieves a single task by its ID |
| [DELETE /v1/tasks/{taskId}](#delete-v1taskstaskid) | Deletes a specific task |

## **GET /v1/tasks**

Expand Down Expand Up @@ -274,6 +275,76 @@ Creates a new task
}
```

## **DELETE /v1/tasks/{taskId}**

Deletes a task with the given `task_id`.

- **Params**

- `task_id`: The unique identifier of the task (as a path parameter)

- **Success Response:**

- **Code:** 204
- **Content:** None

- **Error Responses:**

- **Code:** 400

- **Reason:** Invalid `task_id` format
- **Content:**
```json
{
"statusCode": 400,
"message": "Please enter a valid Task ID format.",
"errors": [
{
"source": {
"path": "task_id"
Comment thread
AnujChhikara marked this conversation as resolved.
Comment thread
AnujChhikara marked this conversation as resolved.
},
"title": "Validation Error",
"detail": "Please enter a valid Task ID format."
}
]
}
```

- **Code:** 404

- **Reason:** Task with the given `task_id` was not found
- **Content:**
```json
{
"statusCode": 404,
"message": "Task with ID <task_id> not found.",
"errors": [
{
"source": {
"path": "task_id"
},
"title": "Resource Not Found",
"detail": "Task with ID <task_id> not found."
}
]
}
```

- **Code:** 500
- **Reason:** Internal server error
- **Content:**
```json
{
"statusCode": 500,
"message": "An unexpected error occurred",
"errors": [
{
"detail": "Internal server error"
}
]
}
```

## **GET /v1/health**

Health check endpoint
Expand Down