Implement comprehensive API documentation system

 Features:
- Comprehensive Pydantic response models with examples
- Enhanced FastAPI configuration with rich OpenAPI metadata
- Centralized error handling with standardized error codes
- Professional Swagger UI styling and branding
- Health check endpoints with detailed component status
- Type-safe request/response models for all endpoints

📊 Coverage:
- Agent Management API fully documented
- Standardized error responses across all endpoints
- Interactive API documentation with try-it-now functionality
- Custom OpenAPI schema with authentication schemes

🛠️ Technical Improvements:
- Created app/models/responses.py with comprehensive models
- Added app/core/error_handlers.py for centralized error handling
- Enhanced app/api/agents.py with detailed documentation
- Custom documentation configuration in app/docs_config.py
- Global exception handlers for consistent error responses

🌐 Access Points:
- Swagger UI: /docs
- ReDoc: /redoc
- OpenAPI JSON: /openapi.json

This establishes professional-grade API documentation that matches
Hive's technical excellence and provides developers with comprehensive,
interactive documentation for efficient integration.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
anthonyrawlins
2025-07-12 10:21:08 +10:00
parent 8619b75296
commit ca18476efc
16 changed files with 1868 additions and 152 deletions

View File

@@ -1,11 +1,11 @@
from fastapi import APIRouter, Depends, HTTPException
from typing import List, Dict, Any
from ..core.auth import get_current_user
from ..core.auth_deps import get_current_user_context
router = APIRouter()
@router.get("/workflows")
async def get_workflows(current_user: dict = Depends(get_current_user)):
async def get_workflows(current_user: Dict[str, Any] = Depends(get_current_user_context)):
"""Get all workflows"""
return {
"workflows": [],
@@ -14,7 +14,7 @@ async def get_workflows(current_user: dict = Depends(get_current_user)):
}
@router.post("/workflows")
async def create_workflow(workflow_data: Dict[str, Any], current_user: dict = Depends(get_current_user)):
async def create_workflow(workflow_data: Dict[str, Any], current_user: Dict[str, Any] = Depends(get_current_user_context)):
"""Create a new workflow"""
return {
"status": "success",