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
Json Validation Bundle

Json Validation Bundle Laravel Package

joipolloi/json-validation-bundle

A Symfony bundle for validating JSON payloads against schemas, helping you enforce request structure and return clear validation errors in your PHP applications.

View on GitHub
Deep Wiki
Context7

This bundle provides a way to validate JSON passed to a request against a schema

Frequently asked questions about Json Validation Bundle
Can I use joipolloi/json-validation-bundle in Laravel?
Not as a native Laravel package. It is a Symfony bundle built around bundle registration, Doctrine annotations, and a controller/kernel event listener, none of which Laravel provides in the same form. Composer may install it, but the Symfony-specific wiring would never be invoked, so the practical choice is to reuse the validation pattern rather than depend on the bundle.
How do I install and configure joipolloi/json-validation-bundle?
In a Symfony application you install it with Composer, register the bundle in bundles.php, and configure validation through the bundle settings. It is not designed for Laravel's service provider and middleware model. For Laravel, implement the same decode, validate, and reject flow with a FormRequest, custom validation rule, or middleware.
Which Laravel versions does joipolloi/json-validation-bundle support?
The package does not advertise Laravel version support because it is a Symfony bundle, not a Laravel package. Its compatibility should be evaluated against Symfony and PHP versions, not Laravel's release cycle. For Laravel projects, choose a maintained JSON Schema engine or build a small first-party adapter instead.
What is a good Laravel alternative to this Symfony JSON Schema bundle?
Use a maintained JSON Schema library directly, likely justinrainbow/json-schema or a newer dialect-compatible engine, and wrap it in a Laravel custom rule, FormRequest, or middleware. For flat payloads, Laravel's built-in required, type, array, and dot-notation rules may be enough. Adopt a schema engine when your payload shape or external contract genuinely requires JSON Schema semantics.
How do I validate incoming JSON payloads against a JSON Schema in Laravel?
Read the payload with $request->json()->all(), validate it with your chosen JSON Schema engine, and convert violations into a ValidationException or a 422 response. Put this in middleware if you want early rejection before controllers, or in a FormRequest if validation belongs with a specific endpoint. Centralize schema files so the same rules are reused across routes and tests.
Does this bundle handle nested JSON objects and arrays?
JSON Schema itself can enforce nested objects, arrays, required keys, and types, and the bundle's purpose is to apply those rules to incoming payloads. Whether that is necessary in Laravel depends on payload complexity; flat or lightly nested payloads are often handled by Laravel's first-party array and dot-notation rules. For deeply nested contracts, a schema engine gives clearer reusable rules.
Which JSON Schema draft does joipolloi/json-validation-bundle support?
The package appears to be an older Symfony-era artifact, so the supported dialect is likely draft-04, but you should verify it before relying on it. Modern contract teams may author against draft 2019-09 or 2020-12, which can create validation gaps that look like passes. If dialect compatibility is a hard requirement, use a maintained engine that states its draft support explicitly.
How should JSON Schema validation errors be returned to API clients?
The bundle surfaces validation failures so they can be returned in API responses, but the response contract is your application's decision. In Laravel, map violations to a 422 JSON response or a ValidationException payload. If clients require RFC 7807 application/problem+json with JSON Pointer paths to failing fields, translate schema errors into that structure explicitly.
Is joipolloi/json-validation-bundle actively maintained and safe for production?
The repository reads as an older, low-activity artifact with zero dependents, deprecated Doctrine Annotations, and no visible CI or security posture. That matters because schema validation runs directly on attacker-controlled input and depends on a transitive JSON Schema engine. For production use, prefer a maintained validator or own a small first-party Laravel implementation you can patch and test.
Should I integrate the bundle or port its validation pattern to Laravel, and how do I test it?
Port the pattern rather than integrate the bundle. The valuable behavior is decoding the JSON body, validating it against a schema, and rejecting invalid payloads with a structured error, which fits in under 100 lines as a Laravel rule, FormRequest, or middleware. Test it with feature tests for valid payloads, missing required keys, wrong types, nested failures, and expected error response shapes.
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