radebatz/openapi-introspector
radebatz/openapi-introspector inspects OpenAPI/Swagger specifications at runtime, exposing endpoints, schemas, and metadata to Laravel and PHP apps. It helps generate documentation, validate APIs, and integrate specs into tooling with a clean, framework-friendly API.
Architecture fit
openapi-introspector is a build-time/documentation-plane tool, not a request-path dependency. It derives an OpenAPI document by introspecting the framework's route table and merging in explicitly declared operations (PHP 8 attributes, and — per the "classic operations" wording in 1.0.1 — annotation-style definitions in the swagger-php tradition). For a Laravel codebase this is architecturally low-risk: it consumes the router and reflection metadata that already exist, and its only output is a generated artifact. It does not sit in the hot path, does not own persistence, and imposes no runtime contract on application code.
Integration feasibility
Straightforward in principle — a Composer dev dependency, a service provider, and a console command or CI step that emits openapi.json/yaml. The 1.0.1 changes are all evidence that the merge semantics between "routes we found" and "operations we were told about" are actively being hardened, which is the exact seam an integrator cares about:
/api/v1/api/v1/...) when servers[].url carries a base path. A correctness fix that directly affected whether generated specs were usable by gateway/codegen consumers.Technical risk Moderate-low, but concentrated in two areas. First, supply chain and bus factor: this is a single-maintainer package at 1.0.x with a small change surface per release. A patch-level release carrying four behavioural corrections to merge logic implies the 1.0.0 semantics were not fully settled. Second, silent incorrectness: the failure mode of a spec generator is not a crash, it is a plausible-looking but wrong contract that downstream codegen and contract tests then trust. None of the 1.0.1 fixes are breaking, but each changes output for some inputs — so any snapshot of a previously generated spec may shift.
Key questions
Stack fit
Assumes a conventional Laravel app or modular monolith with route files and controllers. Best fit is a team that already wants a code-first spec — routes and attributes as the source of truth — rather than a hand-maintained YAML document. It will compete with dedoc/scramble (zero-annotation, Laravel-native) and zircote/swagger-php (annotation-first); the differentiator here is the hybrid merge, which is attractive precisely because it avoids an all-or-nothing migration. If the team has already standardised on hand-written OpenAPI or on Scramble with no annotation appetite, the value proposition is weaker.
Migration path Adopt incrementally, exploiting hybrid mode:
require-dev, register the provider, run the generator against the current route table with introspection only. Treat the output as a report, not a contract — review it.Compatibility
Pin exactly (1.0.1) in the lockfile and treat 1.0.x bumps as reviewable events, since output-shape changes are landing in patch releases. Because the package is dev-only, rollback is a lockfile revert — no deploy required. Verify Laravel/PHP version support before committing; if the app is on an older LTS, confirm before piloting.
Sequencing Bounded pilot first: one bounded context or one route group, generating to an artifact in CI, with a checked-in golden file so spec drift becomes a visible PR diff. Expand coverage only after the merge behaviour (collisions, path parameters, server prefixes) has been observed to behave predictably on real routes. Gate any consumer-side codegen behind the pilot's stability window.
Maintenance Low steady-state cost: one dev dependency, one command, one artifact. The real maintenance surface is the annotation/attribute layer in application code — that is where engineers will spend time, and it needs an owner and a convention (e.g. every new controller ships with its operation attributes). Budget for periodic review of generated-spec diffs, not for runtime upkeep.
Support External support is effectively "read the source and raise an issue" — single maintainer, small community. Internal support burden is therefore ours: nominate one engineer as the owner of the generator configuration and the golden-file test. Document the precedence rules (documented-beats-inferred, positional path-parameter mapping) in the team's API guidelines so failures are diagnosable without reading vendor code.
Scaling Generation cost scales with route count and is a CI-time concern only; for a few hundred routes this is negligible. The scaling risk is organisational, not computational: as more teams annotate, inconsistent conventions proliferate. Centralise shared components (schemas, security schemes, server definitions) rather than letting each module declare its own.
Failure modes
Ramp-up Small for the tool, moderate for the conventions. An engineer familiar with Laravel routing and OpenAPI can be productive in under a day. The genuinely novel concepts to teach are hybrid mode's two sources of truth and the override precedence — a short internal doc plus a reference controller covering path params, request schema, responses, and security is sufficient. Expect the first "why is my spec wrong" incident to be a path-parameter or server-prefix issue, since those are exactly the areas 1.0.1 was still correcting.
How can I help you explore Laravel packages today?