Invalid API Type Parameter
Cause
The requested API type is either:- Not defined in
config/openapi.php - Disabled in the
api_typesconfiguration array - Misspelled in the command or query parameter
Solution
Check your configuration
config/openapi.php and verify the api_types array:Enable the API type
enabled to true for the API type you want to use.Clear config cache
Regenerate documentation
movile is automatically converted to mobile, but you should update your code to use mobile directly.No Routes Found
Cause
Route filtering has excluded all routes. This can happen when:- API type filters remove all matching routes
- Route exclusion patterns are too broad
- No routes are registered with the specified API type
Solution
Review route exclusions
Review route exclusions
config/openapi.php for overly aggressive exclusion patterns:Verify API type filters
Verify API type filters
--api-type, ensure your routes are tagged with that API type:Check route registration
Check route registration
HTTP 500 When Accessing Documentation Endpoint
Cause
Common causes include:- Invalid JSON in template files
- Syntax errors in custom templates
- Exceptions during route introspection
- Memory limits exceeded with large route sets
Solution
Run generation via CLI
Validate JSON templates
resources/openapi/templates/:- Missing commas
- Trailing commas
- Unclosed brackets
- Invalid placeholder syntax
Enable detailed logging
storage/logs/laravel.log for detailed errors.Test with minimal routes
Placeholder Values Not Updating
Cause
Laravel’s config cache is enabled, and some values are read usingenv() at runtime instead of from cached config.
Solution
Clear config cache
Clear OpenAPI cache
Prefer config over env()
.env values, override config values in config/openapi.php:Regenerate documentation
config:cache in production, always set values in config files rather than relying on runtime env() calls.Concurrent Generation File Corruption
Cause
Multiple workers or processes runningopenapi:generate simultaneously write to the same output files.
Solution
Use unique output paths
Use unique output paths
Implement command locking
Implement command locking
Use queue serialization
Use queue serialization
SerializesModels trait and ensure jobs run one at a time:Template JSON Parsing Failures
Cause
Invalid JSON syntax or missing template files inresources/openapi/templates/.
Solution
Verify template exists
openapi.jsonpostman.jsoninsomnia.json
Validate JSON syntax
- Trailing commas:
"key": "value",}❌ - Missing quotes:
{key: "value"}❌ - Unclosed brackets:
{"key": "value"❌
Enable validation in config
Test with default templates
Large Route Sets Causing Timeouts
Cause
Generating documentation for hundreds of routes with complex FormRequest validation can exceed PHP execution time limits.Solution
Use CLI generation and serve static files
Use CLI generation and serve static files
Increase PHP execution time
Increase PHP execution time
Use API type filters
Use API type filters
Optimize route exclusions
Optimize route exclusions
Rate Limiting or Auth Blocking Documentation Routes
Cause
The middleware stack for documentation routes includes authentication or rate limiting:Solution
Use dedicated middleware stack
Create custom middleware for docs
Disable HTTP routes entirely
Stale Cache in Long-Running Workers
Cause
The OpenAPI cache is enabled and has a long TTL, causing workers to serve outdated specs.Solution
Disable cache for queue jobs
Disable cache for queue jobs
Reduce cache TTL
Reduce cache TTL
Clear cache after deployments
Clear cache after deployments