- Can I install hadesarchitect/json-schema-bundle in a Laravel application?
- No. This is a Symfony 2-era bundle that constrains symfony/framework-bundle to ~2.3 and symfony/dependency-injection to ~2.x. Laravel 9, 10, and 11 require Symfony 6.x or 7.x components, so Composer will refuse to resolve the dependency graph. Forcing installation with --ignore-platform-reqs produces a fragile setup that breaks on the next update.
- What is hadesarchitect/json-schema-bundle actually used for?
- It is a lightweight Symfony bundle that wires Justin Rainbow's json-schema validator into Symfony's dependency injection container and configuration tree. It lets Symfony 2 applications validate JSON data against reusable schema definitions. The last release was in June 2016 and it has very low adoption.
- Does this package support Laravel 9, 10, or 11?
- No. Laravel has no Symfony bundle equivalent, so there is no Bundle class registration, Extension::load config tree, or compiler pass consumer for this package. Its Symfony 2 dependency constraints directly conflict with the Symfony 6.x and 7.x packages Laravel pulls in. Use a Laravel-native approach with opis/json-schema instead.
- What is the best Laravel alternative to this JSON Schema bundle?
- Use opis/json-schema v2 directly in Laravel. It supports draft 2019-09 and 2020-12, handles $ref resolution better, and performs well. You can wrap it in a custom ValidationRule, FormRequest, or middleware depending on where validation is needed.
- How do I validate JSON request payloads against a JSON Schema in Laravel?
- Install opis/json-schema and create a custom validation rule or middleware that loads the schema and validates the decoded payload. Map schema violations to a 422 response with a consistent error contract such as RFC 7807 problem details. Decide explicitly whether validation is fail-closed for untrusted input or fail-open with logging for developer guardrails.
- Is justinrainbow/json-schema still maintained?
- It is in low-maintenance status and supports draft-04 only. The active PHP ecosystem has largely moved to opis/json-schema for newer drafts and better $ref handling. Because JSON Schema validation often sits on an untrusted-input boundary, relying on an unmaintained validator is a security-control gap rather than a convenience issue.
- Which JSON Schema drafts does this bundle support?
- It relies on Justin Rainbow's validator, which is draft-04 only. It will not correctly handle 2019-09 or 2020-12 keywords such as unevaluatedProperties, dependentRequired, or $defs. Remote $ref resolution also introduces network I/O into the validation hot path.
- Can I reuse this bundle's configuration pattern in Laravel?
- Yes, the config shape is transferable: a schema directory, default draft setting, and cache toggle. The useful pattern is resolving a schema, constructing a validator, and mapping violations to a framework error response. That is roughly 200 to 400 lines of glue, and none of the Symfony container machinery is needed in Laravel.
- Is this package safe for production validation of untrusted input?
- No. The bundle is abandoned, has no CI, no security advisory triage, and no CVE response path. JSON Schema validation frequently protects webhook ingestion, API payloads, and queue messages, so an unpatched validator on that boundary is a security risk. Use a maintained validator and define an explicit failure policy before implementation.
- How do I migrate from a Symfony 2 JSON Schema bundle to Laravel?
- Do not port the bundle or its dependencies. Reimplement the pattern with opis/json-schema and choose an insertion point: middleware for HTTP requests, FormRequest for form-like payloads, a custom ValidationRule, or queued job middleware for message consumers. Confirm which schema drafts your contracts need, then define a stable error shape for API consumers.