Add comprehensive OpenAPI documentation - Enhanced FastAPI app with detailed API docs and created comprehensive API guide

This commit is contained in:
2025-10-06 09:10:47 +02:00
parent 888acfd33d
commit 67e63911e9
3 changed files with 248 additions and 3 deletions

View File

@@ -229,11 +229,69 @@ async def lifespan(app: FastAPI):
# Create FastAPI application
app = FastAPI(
title="AniWorld API",
description="FastAPI-based AniWorld server with simple master password authentication",
description="""
## AniWorld Management System
A comprehensive FastAPI-based application for managing anime series and episodes.
### Features
* **Series Management**: Search, track, and manage anime series
* **Episode Tracking**: Monitor missing episodes and download progress
* **Authentication**: Secure master password authentication with JWT tokens
* **Real-time Updates**: WebSocket support for live progress tracking
* **File Management**: Automatic file scanning and organization
* **Download Queue**: Queue-based download management system
### Authentication
Most endpoints require authentication using a master password.
Use the `/auth/login` endpoint to obtain a JWT token, then include it
in the `Authorization` header as `Bearer <token>`.
### API Versioning
This API follows semantic versioning. Current version: **1.0.0**
""",
version="1.0.0",
docs_url="/docs",
redoc_url="/redoc",
lifespan=lifespan
lifespan=lifespan,
contact={
"name": "AniWorld API Support",
"url": "https://github.com/your-repo/aniworld",
"email": "support@aniworld.com",
},
license_info={
"name": "MIT",
"url": "https://opensource.org/licenses/MIT",
},
tags_metadata=[
{
"name": "Authentication",
"description": "Operations related to user authentication and session management",
},
{
"name": "Anime",
"description": "Operations for searching and managing anime series",
},
{
"name": "Episodes",
"description": "Operations for managing individual episodes",
},
{
"name": "Downloads",
"description": "Operations for managing the download queue and progress",
},
{
"name": "System",
"description": "System health, configuration, and maintenance operations",
},
{
"name": "Files",
"description": "File system operations and scanning functionality",
},
]
)
# Configure templates