Documentation Index
Fetch the complete documentation index at: https://mintlify.com/charlietyn/openapi-generator/llms.txt
Use this file to discover all available pages before exploring further.
What Are API Types?
API types allow you to segment your API documentation based on different consumers or use cases. Each API type represents a distinct set of routes with its own prefix, making it easy to generate targeted documentation.Admin API
Backend management endpoints for administrators
Mobile API
Optimized endpoints for mobile applications
Site API
Public-facing endpoints for web clients
Configuration
API types are configured inconfig/openapi.php:
Configuration Options
prefix
prefix
Type:
string (required)The route prefix that identifies this API type. Routes starting with this prefix will be included in this API type’s documentation.The prefix must match exactly. Use lowercase and avoid trailing slashes.
file
file
Type:
string (optional)Reference to the route file where this API type’s routes are defined. This is informational and helps developers understand where routes are located.description
description
Type:
string (optional)A detailed description of what this API type is for. Used in generated documentation.folder_name
folder_name
Type:
string (optional)The display name used in Postman collections and Insomnia workspaces. This is how the API type will appear in folder structures.icon
icon
Type:
string (optional)An emoji or icon identifier used for visual distinction in documentation.middleware
middleware
Type:
array (optional)Middleware groups applied to this API type’s routes. Used for documenting security requirements.enabled
enabled
Type:
boolean (default: true)Whether this API type is active. Disabled API types are completely ignored during generation.Setting
enabled: false prevents any routes with this prefix from appearing in documentation.How API Types Work
Route Matching
Routes are assigned to API types based on their URI prefix:- Admin Routes
- Mobile Routes
- Site Routes
Internal Matching Logic
Filtering by API Type
Generate Specific API Types
- CLI
- HTTP Endpoint
- Programmatic
Generate documentation for specific API types only:
Filter Effect on Output
When API types are filtered, the generated title reflects the selection:
Validation & Error Handling
The package validates API types before generation:Invalid API Type
Disabled API Type
Organization in Output
Postman Collection Structure
Insomnia Workspace Structure
OpenAPI Tags
Each API type is reflected in OpenAPI tags:Adding Custom API Types
You can easily add your own API types:Best Practices
Consistent Naming
- Use lowercase for prefixes:
admin, notAdmin - Use descriptive folder_name values:
API Admininstead of justAdmin - Keep icons consistent across similar API types
Logical Separation
- Separate by consumer:
admin,mobile,web - Or by domain:
payments,users,products - Avoid mixing both strategies in the same application
Security Configuration
- Document middleware requirements in the config
- Use different authentication schemes per API type
- Consider rate limiting per API type
Common Use Cases
Multi-Platform Applications
Multi-Platform Applications
Separate APIs for web, mobile, and admin:Benefits:
- Mobile team only sees mobile endpoints
- Admin team has separate documentation
- Different rate limits per platform
Versioned APIs
Versioned APIs
Use API types for versioning:
Generate separate documentation for each version to avoid confusion.
Microservice Integration
Microservice Integration
Document internal vs external APIs:
Next Steps
Environments
Configure deployment environments for your API types
Routes Configuration
Advanced route filtering and exclusion patterns