Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Swagger Lume Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  • The package major version tracks the framework major. 11.0 targets Lumen 11; teams on Lumen 10 stay on 10.x. Framework upgrades therefore force a coordinated package major bump, which belongs in the upgrade runbook rather than being discovered mid-sprint.
  • The transitive constraint is now explicit: 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:

  1. Platform risk, not package risk — still dominant, and mildly sharpened. Lumen 11 support extends the runway to the current major, but it does not reverse the trajectory: Lumen remains effectively feature-frozen relative to full Laravel, and Laravel's own guidance steers new services toward Laravel plus Octane. The 11.0 release keeps us current; it does not change the strategic conclusion. Adopting this package still deepens a commitment to a framework on a slow path to end-of-life. This decision should be made before adoption, not after.
  2. 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.
  3. Bus factor — marginally improved, not resolved. 11.0 is the first release since 10.1, and it lands two external contributor PRs, one of them substantive (Lumen 11). That is genuine evidence of a live maintenance path and reduces the "abandoned" probability. It does not change the underlying profile: single maintainer, ~331 stars, negligible reported dependent count, no commercial backing, no vendor SLA. Treat bus factor as unchanged in severity but slightly better evidenced.
  4. Dependency drift — downgraded. With the wrapper pinned to 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:

  • Which 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.)
  • Are we on attribute-based (PHP 8) syntax or legacy annotations? v4 supports both, so this is now a team convention decision rather than a version constraint. Prefer attributes — it is the forward-compatible path and avoids the deprecation exposure.
  • Is the docs UI route environment-gated, and can it be disabled entirely in production while still publishing the spec artifact?
  • Does generation run in CI (preferred) or on request (anti-pattern)?
  • Are Swagger UI assets vendored or CDN-loaded — an air-gapped or CSP-strict deployment depends on the answer?
  • Does it support multiple specs, security scheme definitions, and per-environment server/base-path overrides?
  • What is the wrapper's timeline for 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.
  • If the maintainer stops releasing, what is our exit — and does the exit preserve the artifact?

Integration Approach

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:

  • From 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.
  • From this package 10.x to 11.0 — mechanical, but requires the Lumen 10→11 upgrade first, since the package major is coupled to the framework major. Sequence it as part of the framework upgrade, not as an independent dependency bump.

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:

  1. Spike on a branch: annotate one controller, generate, diff the output — under Lumen 11 and the pinned swagger-php v4.
  2. Standardize on PHP 8 attributes, not Doctrine annotations, to stay on the forward-compatible surface.
  3. Commit the generated spec to the repository so CI can detect unintentional contract changes.
  4. Gate the UI route by environment and confirm it is off in production.
  5. Expand attribute coverage module by module, prioritized by external consumer count.
  6. Add independent contract guardrails (Spectral linting, openapi-diff in CI) so the package is a producer, not the only quality gate.

Operational Impact

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:

  • Silent empty spec — wrong scan path or a parse error yields a valid but empty document; fail the CI step when the spec has zero paths.
  • Unwritable storage path — image builds that don't create storage/api-docs produce 500s on the docs route.
  • Public exposure of the UI — leaks the full internal endpoint surface; gate by environment, not by hoping.
  • Framework/package version skew — bumping Lumen without bumping the package (or vice versa) leaves an unsupported combination; assert the pair in CI.
  • OpenAPI 3.1 gap — if a gateway, partner, or SDK generator starts requiring 3.1, the swagger-php v4 ceiling becomes a hard blocker with no workaround inside this package; track the wrapper's v5 roadmap as a standing dependency.
  • Platform stranding — Lumen EOL forcing a framework migration; the tail risk to acknowledge in the ADR rather than mitigate with code.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel