{"openapi":"3.0.3","info":{"title":"API «Список задач»","version":"1.0.0","description":"REST API для управления списком задач (создание, просмотр, поиск, сортировка, постраничный вывод, редактирование и удаление).\n\nПримечания по принятым решениям контракта:\n- В исходном примере списка ключ `status` встречается дважды (`\"pending\"` и\n  `\"не выполнена\"`). Используется один `status` со значениями\n  `не выполнена` / `выполнена`.\n\n- Список возвращает массив задач; метаданные пагинации — в заголовках\n  (`X-Total-Count`, `X-Per-Page`, `X-Current-Page`, `X-Last-Page`).\n\n- `create_date` — доменная дата создания: принимается от клиента и хранится\n  как передано; не равна служебной метке `created_at` Laravel.\n\n- Дата и время — Europe/Moscow (МСК), формат `YYYY-MM-DDTHH:MM:SS`.\n"},"servers":[{"url":"http://localhost:8080","description":"Локальное окружение (Docker)"}],"tags":[{"name":"Tasks","description":"Управление задачами"}],"paths":{"/api/tasks":{"get":{"tags":["Tasks"],"summary":"Получение списка задач","description":"Возвращает список задач с поиском по названию и сортировкой по сроку выполнения или дате создания. Результат выводится постранично; метаданные пагинации передаются в заголовках ответа.\n","operationId":"listTasks","parameters":[{"name":"search","in":"query","required":false,"description":"Поиск по названию.","schema":{"type":"string"},"example":"Задача1"},{"name":"sort","in":"query","required":false,"description":"Поле сортировки. `created_at` соответствует дате создания (поле `create_date` в ответе). Без параметра список сортируется по `id` по убыванию; при явном `sort` — по возрастанию.\n","schema":{"type":"string","enum":["due_date","created_at"]},"example":"due_date"},{"name":"page","in":"query","required":false,"description":"Номер страницы.","schema":{"type":"integer","minimum":1,"default":1}},{"name":"per_page","in":"query","required":false,"description":"Размер страницы.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}}],"responses":{"200":{"description":"Список задач.","headers":{"X-Total-Count":{"description":"Общее число задач.","schema":{"type":"integer"},"example":73},"X-Per-Page":{"description":"Размер страницы.","schema":{"type":"integer"},"example":10},"X-Current-Page":{"description":"Текущая страница.","schema":{"type":"integer"},"example":1},"X-Last-Page":{"description":"Номер последней страницы.","schema":{"type":"integer"},"example":5}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"example":[{"id":1,"title":"Задача1","description":"Задача1 описание","due_date":"2025-01-20T15:00:00","create_date":"2025-01-20T15:00:00","status":"не выполнена","priority":"высокий","category":"Работа"}]}}},"422":{"$ref":"#/components/responses/ValidationError"}}},"post":{"tags":["Tasks"],"summary":"Создание задачи","description":"Создаёт новую задачу.","operationId":"createTask","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskRequest"},"example":{"title":"Задача1","description":"Задача1 описание","due_date":"2025-01-20T15:00:00","create_date":"2025-01-20T15:00:00","priority":"высокий","category":"Работа","status":"не выполнена"}}}},"responses":{"201":{"description":"Задача создана.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskCreatedResponse"},"example":{"id":1,"message":"Task created successfully"}}}},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/api/tasks/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Идентификатор задачи.","schema":{"type":"integer","format":"int64","minimum":1},"example":1}],"get":{"tags":["Tasks"],"summary":"Получение конкретной задачи","description":"Возвращает задачу по её идентификатору.","operationId":"showTask","responses":{"200":{"description":"Задача найдена.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"},"example":{"id":1,"title":"Задача1","description":"Задача1 описание","due_date":"2025-01-20T15:00:00","create_date":"2025-01-20T15:00:00","status":"не выполнена","priority":"высокий","category":"Работа"}}}},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Tasks"],"summary":"Обновление задачи","description":"Обновляет задачу. Доступно изменение любого из полей; передаются все изменяемые поля задачи.\n","operationId":"updateTask","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskRequest"},"example":{"title":"Задача2","description":"Задача2 описание обновленное","due_date":"2025-01-25T18:00:00","priority":"низкий","category":"Дом","status":"выполнена"}}}},"responses":{"200":{"description":"Задача обновлена.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"},"example":{"message":"Task updated successfully"}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"}}},"delete":{"tags":["Tasks"],"summary":"Удаление задачи","description":"Удаляет задачу по её идентификатору.","operationId":"deleteTask","responses":{"200":{"description":"Задача удалена.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"},"example":{"message":"Task deleted successfully"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}}},"components":{"schemas":{"TaskStatus":{"type":"string","description":"Статус выполнения задачи.","enum":["не выполнена","выполнена"],"example":"не выполнена"},"TaskPriority":{"type":"string","description":"Приоритет задачи.","enum":["низкий","средний","высокий"],"example":"высокий"},"Task":{"type":"object","description":"Представление задачи.","required":["id","title","description","due_date","create_date","status","priority","category"],"properties":{"id":{"type":"integer","format":"int64","example":1},"title":{"type":"string","maxLength":255,"example":"Задача1"},"description":{"type":"string","nullable":true,"example":"Задача1 описание"},"due_date":{"type":"string","description":"Срок выполнения (МСК), формат YYYY-MM-DDTHH:MM:SS.","example":"2025-01-20T15:00:00"},"create_date":{"type":"string","description":"Доменная дата создания (МСК); хранится в том виде, в котором пришла от клиента. Не равна служебной метке создания записи.\n","example":"2025-01-20T15:00:00"},"status":{"$ref":"#/components/schemas/TaskStatus"},"priority":{"$ref":"#/components/schemas/TaskPriority"},"category":{"type":"string","maxLength":255,"example":"Работа"}}},"CreateTaskRequest":{"type":"object","required":["title","due_date","priority","category"],"properties":{"title":{"type":"string","maxLength":255,"example":"Задача1"},"description":{"type":"string","nullable":true,"example":"Задача1 описание"},"due_date":{"type":"string","description":"Срок выполнения (МСК), формат YYYY-MM-DDTHH:MM:SS.","example":"2025-01-20T15:00:00"},"create_date":{"type":"string","nullable":true,"description":"Доменная дата создания. Принимается от клиента и хранится как передано; не равна служебной метке создания записи.\n","example":"2025-01-20T15:00:00"},"priority":{"$ref":"#/components/schemas/TaskPriority"},"category":{"type":"string","maxLength":255,"description":"Имя категории.","example":"Работа"},"status":{"allOf":[{"$ref":"#/components/schemas/TaskStatus"}],"default":"не выполнена"}}},"UpdateTaskRequest":{"type":"object","description":"Обновление задачи; передаются все изменяемые поля.","required":["title","due_date","priority","category","status"],"properties":{"title":{"type":"string","maxLength":255,"example":"Задача2"},"description":{"type":"string","nullable":true,"example":"Задача2 описание обновленное"},"due_date":{"type":"string","description":"Срок выполнения (МСК), формат YYYY-MM-DDTHH:MM:SS.","example":"2025-01-25T18:00:00"},"priority":{"$ref":"#/components/schemas/TaskPriority"},"category":{"type":"string","maxLength":255,"example":"Дом"},"status":{"$ref":"#/components/schemas/TaskStatus"}}},"TaskCreatedResponse":{"type":"object","required":["id","message"],"properties":{"id":{"type":"integer","format":"int64","example":1},"message":{"type":"string","example":"Task created successfully"}}},"MessageResponse":{"type":"object","required":["message"],"properties":{"message":{"type":"string","example":"Task updated successfully"}}},"ValidationError":{"type":"object","required":["message","errors"],"properties":{"message":{"type":"string","example":"Переданные данные не прошли проверку."},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"example":{"title":["Поле title обязательно для заполнения."]}}}},"NotFoundError":{"type":"object","required":["message"],"properties":{"message":{"type":"string","example":"Задача не найдена."}}}},"responses":{"NotFound":{"description":"Задача не найдена.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"ValidationError":{"description":"Ошибка валидации.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}}