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

Laravel Json Schema Assertions Laravel Package

sixlive/laravel-json-schema-assertions

Validate JSON responses and payloads against JSON Schema definitions in your Laravel tests. Adds expressive assertions like assertJsonSchema so you can verify API structure and contracts with minimal setup.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • API contract testing strategy: Lets teams assert JSON responses conform to a shared JSON Schema, turning "the API returns roughly this shape" into an executable contract. Supports decisions about how strictly to enforce response shapes across versions.
  • Build vs. buy for test assertions: Replaces hand-rolled response-shape assertions with a small, maintained package. Weigh the cost of a dev dependency against writing and owning equivalent assertion helpers.
  • Schema as a shared artifact: If the org already maintains JSON Schema (e.g., alongside OpenAPI components or consumer SDKs), this package lets tests reuse those same schemas rather than duplicating field lists.
  • Platform upgrade timing: v4.4.0 confirms Laravel 12.x compatibility, so Laravel 12 migration planning can proceed without this package as a blocker.
  • Roadmap signal for API versioning: Schema-backed tests make it cheaper to detect accidental breaking changes in payloads, which supports decisions about when to cut new API versions and how to communicate deprecations to consumers.
  • Use cases: public/partner-facing JSON APIs, internal service contracts, SDK-generated clients needing shape guarantees, and regression protection before refactors of serializers/resources.

When to Consider This Package

Adopt when:

  • The codebase is a Laravel app (or Laravel-adjacent test suite) exposing JSON APIs where response shape is part of the contract.
  • The team already values or uses JSON Schema, or wants a portable, language-agnostic description of payloads shared with consumers.
  • You want schema validation inside PHPUnit/Pest tests without standing up a separate contract-testing toolchain.
  • You need a low-ceremony, test-only dependency with an active maintainer and current framework support.

Look elsewhere when:

  • You need full OpenAPI/Swagger request-and-response validation, spec linting, or mock-server generation — dedicated OpenAPI tooling is a better fit.
  • You require runtime (production) payload validation rather than test-time assertions.
  • The stack is not Laravel/PHP, or the team standardizes on another language's contract-testing framework (e.g., Pact for consumer-driven contracts).
  • You want zero third-party dev dependencies and the assertion surface you need is small enough to own in a few helper methods.
  • You need schema evolution governance (versioning, compatibility rules) — that is a process/tooling decision this package supports but does not itself provide.

How to Pitch It (Stakeholders)

To executives: This is a small, test-only dependency that makes API contracts verifiable rather than aspirational. The v4.4.0 release is maintenance work — PHPUnit deprecation fixes and confirmed Laravel 12 compatibility — with no breaking changes. That combination is the signal we want: the package is actively maintained and keeps pace with the framework, so adopting it does not create an upgrade liability. Cost is minimal, benefit is catching unintended payload changes before customers do.

To engineering: Use it to replace ad-hoc assertJsonStructure-style checks where the contract matters. Schemas live as reviewable files, so changes to response shape show up as schema diffs in code review — a much better conversation than a silently passing test. The new release removes PHPUnit deprecation noise and certifies Laravel 12 support, so it slots into the upgrade path cleanly. Recommend adopting incrementally: start with the highest-traffic or partner-facing endpoints, and keep schemas in version control alongside the API code. No action required beyond bumping the dev dependency; there are no migration steps.

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.
microsoft/fluentui-system-icons
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