API Documentation Generator
This skill helps generate detailed API documentation from your codebase.
What to Document
Endpoints
-
HTTP method (GET, POST, PUT, DELETE, etc.)
-
URL path and parameters
-
Query parameters
-
Request body schema
-
Response schema
-
Status codes
Authentication
-
Authentication methods
-
Required headers
-
Token format
Examples
-
Sample requests
-
Sample responses
-
Error responses
Models/Schemas
-
Data structures
-
Field types
-
Validation rules
-
Relationships
Output Format
Generate documentation in one of these formats:
-
Markdown: Human-readable documentation
-
OpenAPI 3.0: Industry standard API specification
-
Postman Collection: For API testing
Process
-
Scan the codebase for API route definitions
-
Extract endpoint information
-
Identify request/response models
-
Generate examples from tests or code
-
Format documentation according to chosen format
Example Output (Markdown)
POST /api/users
Create a new user account.
Request Body
```json { "email": "user@example.com", "password": "secure_password", "name": "John Doe" } ```
Response (201 Created)
```json { "id": "123", "email": "user@example.com", "name": "John Doe", "createdAt": "2025-01-15T10:30:00Z" } ```
Errors
400 Bad Request: Invalid input data409 Conflict: Email already exists