hotmeteor/spectator
Spectator brings lightweight OpenAPI contract testing to your Laravel test suite. Write tests that guarantee your API spec never drifts from your implementation, with artisan validation commands, operation coverage tracking, and JSON error output for CI.
Architecture fit
spectator:routes command is particularly valuable architecturally: it produces a spec-to-route cross-reference, which doubles as an inventory of undocumented endpoints and spec entries with no implementation. As of v3.0.4 this output shows the fully resolved path including route prefixes, which materially improves the artifact for versioned/prefixed API groups (/api/v1/...) where route registration and public paths diverge.Integration feasibility
application/x-www-form-urlencoded request bodies against object schemas), so it is a behavior-affecting patch rather than a no-op.spectator:validate as a spec linter, spectator:routes as a coverage/gap report, assertion helpers in tests, and SpectatorExtension as a coverage gate. All commands support --format=json, which makes CI dashboards and threshold enforcement tractable.Technical risk
additionalProperties, unconstrained fields) produces green tests that miss real contract breaks.Key questions
oneOf/anyOf)?Stack fit
Migration path
spectator:validate and spectator:routes in CI without failing builds. This establishes a baseline of spec validity and route coverage with zero test-writing effort and negligible risk.spectator:stubs to generate skeleton tests, then hand-tightening assertions. Defer form-encoded/upload endpoints until the JSON pilot is stable.Compatibility
composer.json (currently v3.0.4) and include it in the Laravel-major upgrade checklist. Given patch releases can change validation behavior, run the contract suite on any bump rather than relying on semver alone.Sequencing
spectator:validate + spectator:routes non-blocking in CI.SpectatorExtension in report-only mode to measure real operation coverage.Maintenance
Support
Scaling
Failure modes
Ramp-up
How can I help you explore Laravel packages today?