cirlmcesc/laravel-swaggerdoc
Generate OpenAPI 3.0 (Swagger) docs from your Laravel tests/commands. Write tests and produce an interface document automatically, inspired by swagger-php, to keep API documentation in sync with your code.
assertJsonPath()).HttpTests) and integrates with existing routes/controllers without invasive changes. Assumes a RESTful API structure.TestEvent), requiring minimal code changes. No need to modify controllers or routes.darkaonline/l5-swagger as a dependency), but ties the package to an older Swagger library (last updated 2017). Risk of compatibility issues with modern Laravel/OpenAPI tools.darkaonline/l5-swagger (abandoned since 2017), which may not support:
swagger:validate integration).darkaonline/l5-swagger forks or zircote/swagger-php) with better maintenance?openapi-tools/validator?)darkaonline/l5-swagger → zircote/swagger-php).HttpFoundation).phpunit.xml configurations.assertJsonPath() calls).composer.json dependencies (PHP/Laravel versions).// config/swaggerdoc.php
'info' => [
'title' => 'My API',
'version' => '1.0.0',
],
'servers' => [
['url' => 'https://api.example.com/v1', 'description' => 'Production'],
],
spectral or openapi-backup).- name: Generate OpenAPI Spec
run: php artisan test --filter=ApiTest --env=testing --no-interaction
- name: Validate Spec
run: npx @stoplight/spectral lint path/to/openapi.json
/users).darkaonline/l5-swagger deprecations.assertJson() → properties).dd() or Xdebug.spatie/laravel-openapi (more maintained).zircote/swagger-php (standalone, no Laravel tie-in).--filter to target only API tests.php artisan swagger:generate (if supported) outside test runs.openapi-to-html).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Tests miss critical endpoints | Incomplete/inaccurate docs | Enforce test coverage requirements. |
darkaonline/l5-swagger breaks |
Docs generation fails | Fork the package |
How can I help you explore Laravel packages today?