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

Openapi Verifier Laravel Package

radebatz/openapi-verifier

A Laravel package for verifying your API against an OpenAPI specification, helping keep routes, requests, and responses in sync with your docs and catching contract mismatches early in development or CI.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This is a verification/contract-conformance tool, not a runtime feature. Its highest-value placement in a Laravel estate is the HTTP test layer: assert that real TestResponse output actually matches the published OpenAPI document, so the spec and the implementation cannot drift silently. The PSR-15 middleware and Guzzle/PSR-18 client decorators are secondary modes — useful for consumer-side checks against third-party APIs in integration tests, but they should not be treated as production traffic guards. It complements Laravel's request validation and tools like Scramble or knuckles; it does not replace either.

Integration feasibility. Moderate and self-contained. Requirements are an OpenAPI 3.0.x document held in-repo, a PSR-7/PSR-17 implementation, and the transitive league/openapi-psr7-validator. The Laravel adapter (response assertion against the spec) is the genuine differentiator — few packages offer that ergonomics. Exit cost is low because the package is a thin adapter over the league validator; if needed, we can call the underlying validator directly or write our own trait in under a day.

What changed in 2.2.3 (reviewed release). Patch-level, non-breaking, no deprecations, no API surface changes. Two items are relevant to us: (a) CI now runs against the 2.x branch, which tells us the 2.x line is actively maintained but also that it is being treated as a maintenance branch — expect the next capability work (notably OpenAPI 3.1 / JSON Schema 2020-12) to land in a future major; (b) YAML specifications are now explicitly supported via a suggested symfony/yaml dependency, with a clear error message when a YAML spec is supplied without it. The release notes point at github.com/DerManoMann/openapi-verifier — the upstream repository — which is corroborating evidence that published tags track upstream rather than a divergent fork tree.

Technical risk.

  • Bus factor of one, single-digit stars, 0 dependents. Effectively no community validation and no evidence of production use at scale. Treat as "unproven, cheap to adopt, cheap to abandon."
  • Fork lineage — partially resolved. The 2.2.3 release originates from the upstream DerManoMann/openapi-verifier repository, so tag provenance is now better evidenced. Still confirm whether the Laravel adapter layer is upstream code or fork-only (i.e., will it survive the next upstream major).
  • Release metadata anomaly. Confirm from the registry, not the notes: check the actual publish date, tag signing, and that 2.2.3 contains only the two listed PRs before pinning in CI.
  • Next-major uncertainty. 2.x is in maintenance. Assume a 3.x will exist and that it is where OpenAPI 3.1 support arrives. Do not let an unpinned constraint pull us across a major.
  • Spec-version ceiling. The underlying validator's OpenAPI 3.1 / JSON Schema 2020-12 support is a known gap. If our API docs are 3.1, this is a blocker, not a nuisance.
  • Runtime middleware semantics. Fail-open versus fail-closed behaviour depends on the surrounding error handler; a swallowed exception yields silent non-verification, which is worse than no verification.
  • Framework coupling. TestResponse internals have shifted across Laravel 9→12; a single-maintainer package will lag major releases.

Key questions for the maintainer/team.

  1. Is the OpenAPI document the source of truth, or generated from code? Validation is only meaningful in the former case (or as a drift detector in the latter).
  2. Is our spec 3.0.x today, and is 3.1 on the roadmap within 12 months? (If yes, track the next major upstream rather than 2.x.)
  3. Do we need request validation too, or responses only?
  4. Who owns the spec file, and what is the review process for changes to it?
  5. If upstream goes quiet, do we vendor-patch or fall back to the league validator directly? (Decide before adoption, not after.)

Integration Approach

Stack fit. Laravel 10–12 on PHP 8.1+, PHPUnit or Pest, plus a PSR-7 implementation (verify whether one is already present transitively via the HTTP client; if not, add nyholm/psr7 explicitly). Consumer-side use requires a Guzzle or PSR-18 client already in the stack — common in service-to-service integrations. If the spec is authored in YAML (increasingly the default for OpenAPI in most repos, and now explicitly supported as of 2.2.3), add symfony/yaml to require-dev; a JSON spec keeps the dependency count at zero.

Migration path. Add as a require-dev dependency only, pinned to 2.2.3. No production code paths, no config publishing, no migrations. If the package is later abandoned, removal is a one-line composer change plus deletion of the assertion calls.

Compatibility considerations.

  • Pin an exact version (2.2.3) and commit the lockfile; do not float, and do not allow ^2 to carry us into a 3.x without review.
  • Wrap the assertion in our own base test-case trait or helper so the package API appears in exactly one place. This is the single most valuable engineering control here and costs an hour.
  • Choose one spec serialisation (JSON or YAML) for the pilot. YAML reads better in review; JSON avoids an extra dev dependency and any parser-version sensitivity.
  • If exploring PSR-15 middleware mode, note Laravel does not ship a general PSR-15 dispatcher by default — that path needs additional plumbing and should be scoped as a separate spike.
  • External $ref resolution needs checking; keep the spec self-contained if possible to avoid suite failures from path resolution rather than real defects.

Sequencing.

  1. Spec hygiene — confirm 3.0.x, self-contained, in-repo, reviewed like code; decide JSON vs YAML.
  2. Single-endpoint pilot — one high-traffic, well-understood endpoint, non-blocking in CI. Measure runtime cost and false-positive rate.
  3. CI gate, advisory — run across a defined endpoint subset, report-only, for two to four weeks.
  4. CI gate, blocking — on the critical surface only (auth, payments, public contract endpoints).
  5. Consumer-side checks (optional) — Guzzle/PSR-18 decorator against a third-party API in integration tests.

The 2.2.3 changes do not alter this path; steps 1–2 proceed unchanged.

Operational Impact

Maintenance. Near-zero production footprint; the burden is dependency hygiene — quarterly review of upstream activity (watch specifically for a 3.x / OpenAPI 3.1 announcement, since 2.x is now a maintenance branch), Laravel compatibility against our next major upgrade, and a standing decision to fork internally if the maintainer goes quiet. Budget roughly half a day per quarter plus a half-day at each Laravel major.

Support. No commercial support, no SLA, community issues only. Acceptable precisely because the blast radius is a dev dependency. The internal wrapper trait is our insurance policy.

Scaling. Validation is not free — parsing the spec and validating large response bodies adds seconds per test. On a suite of hundreds of HTTP tests this compounds. Mitigations: scope to critical endpoints rather than all of them, reuse a parsed spec instance across tests where the package permits, and keep large fixture payloads out of the validated set. Do not put this in the runtime request path; the latency and failure-handling trade-offs are not worth it.

Failure modes to plan for.

  • Spec drift noise — if the spec is generated from code, validation becomes circular and adds no signal. Confirm direction first.
  • False confidence — validator laxity (format assertions, additionalProperties) can pass responses that violate intent. Do not present a green run as full contract assurance.
  • Silent skips — swallowed exceptions in middleware mode, or skipped tests when the spec path is missing, produce green builds with zero verification. Fail loudly on missing spec. Note 2.2.3 improves the YAML-without-parser diagnostic; it does not fix silent skips in general.
  • Upgrade breakage — a Laravel major bump breaks the TestResponse coupling and the gate quietly stops running. Add a canary assertion that is known to fail if the harness is not wired up.
  • Unintended major upgrade — an unconstrained version range pulling in a future 3.x could change validation defaults under us. Pin.

Ramp-up. Low for anyone who has read an OpenAPI document — roughly one day to first meaningful assertion, with the real effort spent on spec ownership and gate policy rather than tooling.

TPM recommendation. Adopt narrowly as a dev-only contract-conformance check behind an internal wrapper, pinned to 2.2.3, gated to a critical endpoint subset, with an explicit abandon-and-vendor trigger. The 2.2.3 release is a positive maintenance signal (active CI on the line, a real usability fix, clearer provenance) but does not change the fundamentals: single maintainer, minimal adoption evidence, and a known 3.1 gap. The low exit cost and the scarcity of Laravel-native TestResponse assertions still argue for a cheap, bounded pilot rather than broad rollout or any production-path use.

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.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle