ronasit/laravel-swagger
Generate Swagger/OpenAPI documentation for your Laravel API directly from annotations in your controllers, with automatic route discovery, a bundled UI, and support for the OpenAPI spec.
SwaggerService/SwaggerSpecValidator with OpenAPI 3.0 (#203) mean fewer hand-written YAML files and fewer "docs drifted from code" incidents. PM decision enabled: stop budgeting manual API doc maintenance; budget review time on generated diffs instead.with[] and with_count[] into separate, documented query params per relation (#198) directly improves the quality of the most-used endpoints in most Laravel APIs (Spatie Query Builder style includes). This is a consumer-facing correctness fix, not cosmetics — it reduces integration support tickets and wrong assumptions about eager-loading semantics.type key) so the debug surface is presentable in non-prod environments shared with stakeholders.local driver fix (#187) and the empty temp_documentation.json production-data fix (#177) address the failure classes that make doc generation flaky in CI — the difference between "docs pipeline is trusted" and "someone regenerates them before a release."Adopt when:
with[], with_count[]) and want those documented per-relation.Look elsewhere or defer when:
Before committing: validate the generated spec against your own OpenAPI 3.0 linter, and confirm the error-page changes are acceptable in any shared non-production environment (they alter what stakeholders see on a 500).
For executives (one paragraph): We currently spend engineering time keeping API documentation in sync with the code, and out-of-sync docs create support load and slow down partner integrations. This package generates the API specification directly from our Laravel code, and release 3.3 makes that output machine-consumable (OpenAPI 3.0 alignment), covers a broader set of controller patterns, and documents our relation-based query parameters properly. It also adds PHP 8.4 test coverage, which de-risks our planned runtime upgrade. Net effect: lower documentation cost, faster and more accurate external integrations, and one fewer blocker on the platform upgrade path — without adding a vendor contract.
For engineering: 3.3 is a coverage-and-correctness release, not a rewrite. Wins: invokable controllers documented, DI-by-contract resolution fixed, OpenAPI 3.0 alignment in the validator, with[]/with_count[] expanded into discrete documented query params, CI across all supported version combos, PHP 8.4 in the matrix, and a set of fixes targeting real CI pain (parallel-test token mocking, local driver, empty temp JSON clobbering production data, versioning docs). Formatting/consistency improved via a newly added Laravel Pint config.
Caveats to state up front: PHPUnit 12 support was merged and then reverted in the same release — pin your test tooling and confirm compatibility rather than assuming parity. This is a community-maintained package; we should pin a version, run our own spec validation in CI, and keep the generation step behind a check so an upstream regression cannot silently ship a broken contract. Recommend adopting 3.3 behind a pinned constraint with a spec-lint gate, then evaluating removal of any in-house doc tooling in the following cycle.
How can I help you explore Laravel packages today?