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 Httpfoundation Testing Laravel Package

osteel/openapi-httpfoundation-testing

Validate Laravel HTTP test responses against an OpenAPI schema. Integrates with HTTP Foundation testing to assert that API responses match your OpenAPI specification, helping catch contract drift early.

Deep Wiki
Context7

Product Decisions This Supports

  • Contract-first vs code-first API development. Adopting this package is a strategic commitment that the OpenAPI document is the source of truth. That decision cascades: it determines whether docs, SDKs, mock servers, and partner portals can be generated from one artifact instead of hand-maintained.
  • Roadmap: public / partner-facing API surface. If the roadmap includes external consumers, deprecation windows, or versioned endpoints, spec-conformance tests give releases a safety net. Without them, "is this a breaking change?" is a judgment call in code review.
  • Build vs buy. Custom spec-drift validation is roughly a week of engineering plus permanent maintenance. Buying here means taking on a free, MIT-licensed dev dependency — the real decision is "do we enforce the contract at all?"
  • Refactor and upgrade bets. Approving a Laravel/PHP major upgrade or an internal re-architecture is much cheaper when a test asserts the wire format didn't move.
  • Spec quality as a product metric. Once every relevant test validates against the spec, drift becomes measurable and visible. That unblocks trusting generated documentation and generated client SDKs, which is a prerequisite for self-serve integrations.
  • Alternatives evaluated: Pact-style consumer-driven contract testing (heavier, needs a broker and multi-team coordination), runtime middleware validation (adds production latency and failure modes), manual review (doesn't scale). This package occupies the "test-time, in-process, zero runtime cost, single-artifact" niche.
  • Prioritization input: coverage should go to revenue-bearing and externally consumed endpoints first — that's a roadmap sequencing decision this tool makes concrete.

When to Consider This Package

Adopt when:

  • You maintain an OpenAPI 3.x document and want it enforced in CI rather than merely trusted.
  • The application is Laravel or Symfony — anything producing HttpFoundation requests/responses — with a PHPUnit or Pest suite already in place.
  • The API is externally consumed by partners, mobile clients, generated SDKs, or a developer portal, where an undocumented break is expensive.
  • You are moving toward generated docs, generated clients, or mock servers and need the spec to be provably accurate.
  • You want contract assurance without adding a validator to the request path.

Look elsewhere when:

  • The spec is OpenAPI 2.0 / Swagger, or the stack is gRPC/GraphQL — different tooling entirely.
  • The spec is stale or aspirational and has no owner; the package will surface a wall of failures before delivering any value.
  • You need production-time validation (reject malformed traffic, schema-based rate limiting). That's a middleware/PSR-7 validator; this is a test-time tool.
  • The test suite is thin or the team won't maintain the spec — enforcement without ownership becomes a skipped test.
  • You need a managed contract broker tracking many consumer/provider pairs. This validates against one artifact; it is not a broker.
  • Dependency-risk tolerance is low: this is a small, single-maintainer project (~121 stars). Pin the version, isolate it behind a base test case, and accept that the underlying capability is replaceable with a thin wrapper over league/openapi-psr7-validator if the package stalls.

How to Pitch It (Stakeholders)

Executive summary. Our API is a product surface, and its OpenAPI document is the contract we publish to partners, mobile clients, and anyone generating an integration. Today nothing verifies the code actually matches that document — so drift is discovered by customers and support, not by CI. This package adds an assertion layer to our existing test suite so every covered endpoint is checked against the spec on every build. It's a free, MIT-licensed dev dependency, requires no runtime infrastructure, and adds no production latency. The payoff is fewer integration incidents, documentation we can hand to partners without a disclaimer, and the ability to generate SDKs and mocks — which is the difference between "we have docs" and "we have a supported integration product."

For engineering. It's a small PHPUnit/Pest helper: point it at the spec, then assert requests and responses (HttpFoundation objects) match the definition. It slots in beside Laravel's HTTP test helpers, costs a few lines per test, and runs only in CI. It converts spec drift into a red build instead of a support ticket, and makes large refactors and framework upgrades safe to approve because the wire format is pinned. Caveats: responses must be validated against realistic fixtures, loosely typed schemas need tightening before they'll pass, and the project is single-maintainer — pin the version and keep the integration behind one base test case so it's swappable.

The ask. Roughly one engineer-week to wire it in and backfill coverage for top-priority endpoints (public and partner-facing), plus a named owner for the spec file. Success criteria: zero undocumented breaking changes across the next two releases, and 100% spec coverage on externally consumed endpoints.

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.
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent