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

Behat Openapi Psr7 Validator Laravel Package

macpaw/behat-openapi-psr7-validator

Behat extension for validating PSR-7 HTTP requests and responses against OpenAPI specifications. Add schema-driven API contract checks to Behat scenarios with ready-to-use steps for request and response validation.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Spec-first vs. spec-as-artifact: This package makes the OpenAPI document executable. If the spec is enforced in CI on every Behat scenario, it becomes a source of truth rather than stale documentation — that's a workflow/process decision a PM can fund and measure (spec drift incidents per quarter).
  • Build vs. buy for contract validation: The underlying validation logic already exists in league/openapi-psr7-validator. This package is a thin Behat integration layer. The real decision is "do we write and maintain a Behat context for OpenAPI assertions ourselves, or adopt this adapter?" — a few days of engineering time versus a dependency with essentially zero external adoption. The v1.1.0 release is maintenance-only (PHPStan fix, AGENTS.md, widened dependency constraints) and does not change that calculus: it is a small convenience layer, not a platform.
  • API contract testing as a release gate: Usable as a CI gate for HTTP request/response conformance in acceptance suites — supports decisions about release readiness, breaking-change policy, and whether minor versions can ship without consumer sign-off.
  • Roadmap input on test strategy: If a team is already invested in Behat, this preserves that investment while adding contract coverage. If the team is standardizing on PHPUnit/Pest, this package is evidence against deepening the Behat commitment.
  • Use cases where it fits: legacy APIs with a real-but-unenforced OpenAPI 3.x spec; microservice boundary verification where the consumer's expectations can be asserted against the provider's spec; regression detection on response shape (field additions/removals, type changes) that functional assertions miss.
  • Portfolio risk signal: Still 1 star, 0 dependents, single-vendor origin (MacPaw). The 1.1.0 bump shows the package is maintained rather than abandoned — a live maintainer responding to ecosystem drift — but maintenance is not the same as adoption or support. Any adoption decision should remain "low-cost trial with a documented exit," not "platform commitment."

When to Consider This Package

Adopt or trial when all of these hold:

  • The team already runs Behat for HTTP-level acceptance tests and has no near-term plan to migrate off it.
  • HTTP interactions go through a PSR-7 client (Guzzle, Symfony HttpClient with PSR-7 bridge), which is what league/openapi-psr7-validator consumes.
  • A maintained OpenAPI 3.x document exists and is generated or reviewed as part of the normal workflow — not abandoned.
  • There's a concrete pain point: spec drift causing consumer breakage, or manual review burden on API changes.
  • Engineering is comfortable pinning to a commit/tag and vendoring or forking if upstream stalls.

Version 1.1.0 widened dependency constraints to support current package releases, which reduces the odds of install-time conflicts against a modern Laravel/Symfony/Behat stack — verify against your own pinned versions before committing, but treat "cannot install without conflict" as a lower-probability blocker than it would have been on 1.0.x. The upgrade itself is non-breaking: no API, config, or behaviour changes are described, so pinning to ^1.1 is low risk.

Look elsewhere when:

  • The stack is Laravel-native testing (Pest/PHPUnit with $this->getJson()). Calling the validator directly from a test helper is less machinery and avoids the Behat dependency — Behat is a heavy tax for one assertion type.
  • There is no reliable spec, or the spec is Swagger 2.0 / partially hand-maintained. Validation against a wrong spec produces false confidence and noisy failures; fix the spec first.
  • You need schema-only validation (JSON Schema without OpenAPI semantics) — a lighter library covers it.
  • You need active vendor support, CVE response, or a support contract. A recent maintenance release does not provide that; single-maintainer, near-zero-adoption packages don't either. Budget for ownership.
  • The team is not on BDD and has no intention of being. Introducing Behat to use this package inverts the cost/benefit.
  • Performance-sensitive suites: full OpenAPI validation on every response adds meaningful runtime; if the acceptance suite is already slow, scope it to contract-critical scenarios only.

How to Pitch It (Stakeholders)

To executives: This is cheap insurance against API contract drift. It converts the OpenAPI document we already maintain into an automated check that runs on every build, so breaking changes to our API surface get caught before customers do. Cost is a small integration effort on top of an existing MIT-licensed validator; risk is contained because we can pin it and replace it with a few days of in-house work if the project stalls. The latest release (v1.1.0) is routine upkeep — dependency widening and a static-analysis fix — which is a positive signal that the project isn't dormant, but it doesn't change the strategic picture: no meaningful third-party adoption and no commercial support. Recommendation: a scoped trial on one service with a healthy spec, with success measured by spec-drift defects caught pre-release.

To engineering: It's a thin Behat extension wrapping league/openapi-psr7-validator, so the validation semantics are the well-established library's, not the extension's — the blast radius is small. Value is highest if you're already on Behat with a PSR-7 client and a live OpenAPI 3.x spec; then it's an afternoon to wire into a context and a CI job. v1.1.0 is a hygiene release — no breaking changes, no new features, updated constraints to track current package versions — so upgrading or starting on ^1.1 is a low-risk move and the lockfile conflict surface is narrower than on 1.0.x. Be honest about maturity: 1 star, no dependents, single maintainer. Pin the version, keep the validation call behind our own context class so the dependency is swappable, and scope it to the endpoints where contract stability actually matters rather than every scenario. If you're on Pest/PHPUnit, skip this and call the validator directly — you get the same coverage without adopting Behat.

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.
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names