openapi: "3.0.0" info: title: "Task Manager API" description: "API для управления задачами, проектами и пользователями" version: "1.0.0" servers: - url: "http://localhost:8080/api/v1" description: "Локальный сервер для тестирования API" paths: /user/login: post: summary: "Вход пользователя в систему" description: "Авторизация пользователя по имени и паролю" requestBody: required: true content: application/json: schema: type: object properties: name: type: string example: "johndoe" description: "Имя пользователя" password: type: string example: "12345" description: "Пароль пользователя" responses: "200": description: "Авторизация успешна" content: application/json: schema: type: object properties: id: type: integer name: type: string email: type: string "401": description: "Недействительный логин или пароль" content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /user/register: post: summary: "Регистрация нового пользователя" description: "Создание нового аккаунта пользователя" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/User" responses: "201": description: "Пользователь успешно зарегистрирован" content: application/json: schema: $ref: "#/components/schemas/User" "400": description: "Ошибка в запросе" content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /user/tasks: get: summary: "Получить задачи пользователя" description: "Возвращает список задач для указанного пользователя" parameters: - name: "id_user" in: query required: true schema: type: integer example: 1 description: "ID пользователя" responses: "200": description: "Список задач пользователя" content: application/json: schema: type: array items: $ref: "#/components/schemas/Task" "400": description: "Отсутствует ID пользователя" content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /user/projects: get: summary: "Получить проекты пользователя" description: "Возвращает список проектов, связанных с пользователем" parameters: - name: "id_user" in: query required: true schema: type: integer example: 1 description: "ID пользователя" responses: "200": description: "Список проектов" content: application/json: schema: type: array items: type: string "400": description: "Отсутствует ID пользователя" content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /projects: post: summary: "Создать проект" description: "Создание нового проекта (в разработке)" responses: "501": description: "Не реализовано" content: application/json: schema: $ref: "#/components/schemas/UnimplementedResponse" get: summary: "Получить проекты" description: "Получение списка всех проектов (в разработке)" responses: "501": description: "Не реализовано" content: application/json: schema: $ref: "#/components/schemas/UnimplementedResponse" /projects/tasks: post: summary: "Создать задачу" description: "Создание новой задачи для проекта" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/Task" responses: "201": description: "Задача успешно создана" content: application/json: schema: $ref: "#/components/schemas/Task" "400": description: "Ошибка в запросе" content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /projects/tasks/{task_id}: patch: summary: "Обновить задачу" description: "Изменение данных задачи по ID" parameters: - name: "task_id" in: path required: true schema: type: integer example: 42 description: "ID задачи" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/Task" responses: "200": description: "Задача успешно обновлена" content: application/json: schema: $ref: "#/components/schemas/Task" "400": description: "Ошибка в запросе" content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /projects/sprints: post: summary: "Создать спринт" description: "Создание спринта в проекте (в разработке)" responses: "501": description: "Не реализовано" content: application/json: schema: $ref: "#/components/schemas/UnimplementedResponse" components: schemas: ErrorResponse: type: object properties: code: type: integer description: "HTTP-код ошибки" message: type: string description: "Сообщение об ошибке" error: type: string description: "Машинное описание ошибки" UnimplementedResponse: type: object properties: message: type: string example: "Not implemented" User: type: object properties: name: type: string email: type: string password: type: string Task: type: object properties: id: type: integer name: type: string description: type: string