darkaonline/swagger-lume
SwaggerLume brings Swagger/OpenAPI documentation to Laravel and Lumen apps. It wraps swagger-php to scan your annotations and generate interactive API docs, with a bundled Swagger UI and simple configuration.
Architecture fit. Unchanged. darkaonline/swagger-lume remains a thin integration layer, not a documentation engine: a Lumen service provider registering a docs route, a config file controlling scan paths and output location, and a console command that invokes zircote/swagger-php to compile annotations/attributes into an OpenAPI artifact served by a Swagger UI blade view. It is a build-time codegen tool wearing a runtime UI hat — appropriate for an API-first Lumen service publishing a contract for consumers, SDK generation, or gateway import; inappropriate if stakeholders expect runtime request/response validation, contract testing, or mock servers. Release 11.0 changes none of this; it is a compatibility and maintenance release, not a capability release.
Integration feasibility. Straightforward and now better signposted. composer require darkaonline/swagger-lume, manually register the provider in bootstrap/app.php (Lumen has no package auto-discovery), publish config, annotate controllers. Release 11.0 adds explicit Lumen 11 support (PR #140) and a documentation tip on importing the OpenApi\Annotations namespace (PR #102 — docs only, no runtime effect). Two integration facts follow from the release:
swagger-php v4. This resolves the previously open question about which major is pinned — the wrapper sits on v4, not v5.Lumen-specific friction is unchanged: no default facade aliasing, a reduced Artisan command set, route registration bypassing standard middleware groups, and a writable storage/api-docs path that must be provisioned in container images.
Technical risk. Four risks, reordered by what the release actually told us:
swagger-php v4 ceiling — now confirmed, and it costs us OpenAPI 3.1. Because the wrapper targets v4, the v4→v5 transition (which drops Doctrine annotation support and gates OpenAPI 3.1) is out of reach until the wrapper moves. Practical consequences: OpenAPI 3.1 remains unavailable, and legacy Doctrine annotation syntax remains viable alongside PHP 8 attributes. The upside is that the previously flagged "silent semantics change on a routine composer update" is largely neutralized by the wrapper's own constraint — but we should still pin and lock explicitly rather than inherit the constraint transitively.swagger-php v4, the routine-update failure mode described previously is much less likely. Residual exposure is PHP 8.1+ deprecation noise in the annotation-parsing path if legacy annotation syntax is retained instead of attributes.Key questions for the maintainer/team:
swagger-php major is pinned in our lockfile — confirm v4, and confirm we are not relying on the wrapper's constraint alone. (Answered at the package level by 11.0; verify locally.)swagger-php v5 (and therefore OpenAPI 3.1)? If we need 3.1 for a gateway or partner contract, this package is a blocker today.Stack fit. PHP 8.x, Lumen 8–11, Composer 2. 11.0 makes Lumen 11 a supported target rather than an untested one, which removes the main reason a new service would have hesitated. Coexists cleanly with PHPUnit/Pest and any existing middleware stack. Register the docs route outside the authenticated API middleware group, or behind a dedicated guard if internal-only. No database assumptions, so it stays orthogonal to the data layer and cheap to remove.
Migration path. Two distinct paths, and they should not be conflated:
darkaonline/l5-swagger — same maintainer, far larger community; config keys and annotation namespaces map largely 1:1, with provider registration and route/middleware wiring being the Lumen-specific deltas.The decisive point is unchanged and should be stated in the decision record: the OpenAPI document is portable. The spec artifact outlives the tool that produced it, which bounds migration cost to the annotation/attribute surface and UI hosting.
Compatibility. The real matrix is still swagger-php version × PHP version × Lumen version. 11.0 narrows it: swagger-php v4, Lumen 11, PHP 8.x. Pin the transitive dependency explicitly in the lockfile. Verify vendor:publish tags behave under Lumen's reduced Artisan. If legacy annotation syntax is retained, watch PHP 8.1+ deprecations in the parsing path — this is the one remaining drift vector.
Sequencing. Recommended rollout:
swagger-php v4.openapi-diff in CI) so the package is a producer, not the only quality gate.Maintenance. Small surface area; single-maintainer risk means we own the fallback. 11.0 is encouraging evidence of continued maintenance and buys runway through the Lumen 11 cycle, but budget a few hours per quarter for dependency bumps and a hard pin on swagger-php v4. Versioning the generated spec in git remains the key operational hedge: if the package is abandoned, the contract survives and the replacement effort becomes a UI-hosting problem rather than a documentation-loss problem.
Support. Community-only via GitHub issues, no commercial tier. 11.0's two external contributors slightly widen the pool of people who have touched the codebase, but there is still no vendor. A named internal owner is mandatory, plus a documented "regenerate the docs" runbook so the process is not tribal knowledge.
Scaling. Generation is O(annotated files) and belongs in CI — negligible cost, linear in codebase size at build time only. Runtime serving is static assets, effectively free. Per-request generation is the failure mode to design out from day one.
Failure modes to instrument:
storage/api-docs produce 500s on the docs route.swagger-php v4 ceiling becomes a hard blocker with no workaround inside this package; track the wrapper's v5 roadmap as a standing dependency.Ramp-up. A PHP developer familiar with OpenAPI is productive in under a day; the learning curve is attribute syntax and scan-path configuration, not the package itself. Documentation is thin — the namespace-import tip added in 11.0 is a small improvement but not a substitute — so plan a short internal README capturing our conventions.
Release verdict. 11.0 is a positive, low-risk maintenance release: it adds Lumen 11 support, lands two external contributions, and makes the swagger-php v4 constraint explicit. It resolves the "which major is pinned" question and slightly reduces abandonment risk. It does not resolve the two things that actually matter for a decision — the swagger-php v5 / OpenAPI 3.1 ceiling and the Lumen platform trajectory. Overall: low integration cost, real but bounded technical risk, one dominant strategic concern to be decided before adoption.
How can I help you explore Laravel packages today?