OpenAPI 3.0 API Documentation Generator
documentation
YAML
scaffolding
minimalist
Generate a complete OpenAPI 3.0 specification with authentication, CRUD endpoints, and examples.
By alex_dev
12/8/2025
Prompt
Generate a complete OpenAPI 3.0 specification for a RESTful API with the following requirements:
API Details
- API Name: [Specify API name]
- Base URL: https://api.example.com/v1
- Version: 1.0.0
- Authentication: JWT Bearer tokens
Endpoints to Document
Create full OpenAPI documentation for these endpoints:
-
GET /users/{id} - Retrieve user by ID
- Path parameter: id (UUID)
- Returns: User object with id, email, name, created_at
- Status codes: 200 (success), 404 (not found), 401 (unauthorized)
-
GET /users - List all users (paginated)
- Query params: page (integer, default 1), limit (integer, default 20)
- Returns: Array of users with pagination metadata
- Status codes: 200, 401
-
POST /users - Create new user
- Request body: email (required), name (required), password (required)
- Returns: Created user object
- Status codes: 201 (created), 400 (validation error), 401
-
PUT /users/{id} - Update user
- Path parameter: id (UUID)
- Request body: email (optional), name (optional)
- Returns: Updated user object
- Status codes: 200, 400, 404, 401
-
DELETE /users/{id} - Delete user
- Path parameter: id (UUID)
- Returns: 204 No Content
- Status codes: 204, 404, 401
Requirements
Include in the OpenAPI spec:
- Info section with title, version, description, contact, and license (MIT)
- Server configurations for production, staging, and local development
- Complete request/response schemas with proper types and validation rules
- Reusable components for User schema, Error schema, and pagination
- Security scheme definition for JWT Bearer authentication
- Apply security requirements to protected endpoints
- Request and response examples for each endpoint
- Proper error response schemas with code and message fields
- Tags to organize endpoints (Users, Authentication)
- Description for each endpoint explaining its purpose
Output the complete YAML OpenAPI 3.0 specification ready for Swagger UI or Redoc rendering.
Tags
openapi
api-docs
swagger
documentation
Tested Models
gpt-4
claude-3-sonnet