{ "openapi": "3.0.3", "info": { "title": "Android Karaoke MVP API", "description": "REST API для обработки аудиофайлов и создания караоке минусовок", "version": "1.0.0" }, "servers": [ { "url": "http://localhost:8000", "description": "Development server" } ], "paths": { "/health": { "get": { "summary": "Health check", "description": "Проверка работоспособности сервера", "responses": { "200": { "description": "Server is healthy", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "example": "ok" }, "timestamp": { "type": "string", "format": "date-time" } } } } } } } } }, "/api/v1/upload": { "post": { "summary": "Upload audio file for processing", "description": "Загружает аудиофайл и запускает процесс создания минусовки", "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "file": { "type": "string", "format": "binary", "description": "Audio file (max 100MB)" }, "quality": { "type": "string", "enum": ["HIGH", "MEDIUM", "ECONOMY"], "description": "Requested output quality" } }, "required": ["file", "quality"] } } } }, "responses": { "202": { "description": "File uploaded successfully, processing started", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskCreatedResponse" } } } }, "400": { "description": "Bad request (invalid file, size too large, etc.)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "413": { "description": "File too large (>100MB)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/v1/tasks/{taskId}/status": { "get": { "summary": "Get processing task status", "description": "Получает текущий статус обработки файла", "parameters": [ { "name": "taskId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Task ID returned from upload" } ], "responses": { "200": { "description": "Task status retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskStatusResponse" } } } }, "404": { "description": "Task not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/v1/tasks/{taskId}/cancel": { "post": { "summary": "Cancel processing task", "description": "Отменяет обработку файла (если еще не завершена)", "parameters": [ { "name": "taskId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Task cancelled successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "example": "Task cancelled successfully" } } } } } }, "404": { "description": "Task not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Task cannot be cancelled (already completed)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/api/v1/tasks/{taskId}/download": { "get": { "summary": "Download processed instrumental", "description": "Скачивает готовую минусовку", "parameters": [ { "name": "taskId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Instrumental file", "content": { "audio/wav": { "schema": { "type": "string", "format": "binary" } }, "audio/mp3": { "schema": { "type": "string", "format": "binary" } } } }, "404": { "description": "Task not found or processing not completed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } } }, "components": { "schemas": { "TaskCreatedResponse": { "type": "object", "properties": { "taskId": { "type": "string", "description": "Unique task identifier", "example": "task_550e8400-e29b-41d4-a716-446655440000" }, "status": { "type": "string", "enum": ["QUEUED"], "description": "Initial task status" }, "estimatedDuration": { "type": "integer", "description": "Estimated processing time in seconds", "example": 180 } }, "required": ["taskId", "status"] }, "TaskStatusResponse": { "type": "object", "properties": { "taskId": { "type": "string" }, "status": { "type": "string", "enum": ["QUEUED", "PROCESSING", "COMPLETED", "ERROR"] }, "progress": { "type": "integer", "minimum": 0, "maximum": 100, "description": "Progress percentage" }, "errorMessage": { "type": "string", "nullable": true, "description": "Error message if status is ERROR" }, "estimatedTimeRemaining": { "type": "integer", "nullable": true, "description": "Estimated remaining time in seconds" }, "startedAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": "string", "format": "date-time", "nullable": true } }, "required": ["taskId", "status", "progress", "startedAt"] }, "ErrorResponse": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type or code" }, "message": { "type": "string", "description": "Human-readable error message" }, "details": { "type": "object", "nullable": true, "description": "Additional error details" } }, "required": ["error", "message"] } } } }