outcomer/symfony-json-schema-validation
Symfony integration for validating JSON documents against JSON Schema. Adds validator constraints and services so you can enforce schemas in forms, requests, or domain objects with familiar Symfony validation workflows.
Architecture fit. This is a Symfony bundle, not a Laravel package. It ships as a bundle with a DependencyInjection extension, service definitions, and presumably a config tree — all artifacts of Symfony's FrameworkBundle lifecycle. Laravel has no loader for bundles; its container, config repository, and service-provider bootstrapping are incompatible with Symfony's compiler passes and extension load() semantics. The only framework-agnostic piece is the OPIS (opis/json-schema) validator underneath, which is a standalone Composer library available to any PHP project.
Integration feasibility. Feasible only by reimplementation. You would pull the bundle's schema-resolution and error-normalization logic out of its DI wiring and re-host it in a Laravel service provider or a custom ValidationRule. That is a modest amount of work, but it means the package itself provides almost no value to a Laravel codebase — you are adopting it for a thin wrapper you then have to tear apart. The higher-leverage path is to depend on opis/json-schema directly and write ~100 lines of Laravel glue.
Technical risk. Materially high for the value delivered. Signals: 20 stars, 0 dependents, aggregate score 0.1. Zero dependents means no downstream community is exercising upgrade paths, so compatibility breakage will surface in your repo first. The dependency chain is two deep (bundle → OPIS → paragonie/random_compat-style transitive deps), doubling the surface that can drift.
Key questions.
TPM recommendation: do not adopt the bundle. Adopt opis/json-schema directly.
Stack fit. Poor for Laravel; potentially fine for a Symfony service in the same estate. If the organization runs both frameworks, treat this as a Symfony-scoped decision and explicitly keep it out of the Laravel dependency graph to avoid symfony/framework-bundle and symfony/dependency-injection leaking into a Laravel composer.json.
Compatibility. Before any code is written, resolve the version matrix: PHP version, OPIS major, and whether the bundle's Symfony constraints conflict with anything Laravel already pulls in. Symfony components can co-exist with Illuminate packages, but they add load-order and autoload weight with no runtime benefit in a Laravel app.
Migration path. Two viable routes:
opis/json-schema standalone, implement a JsonSchemaRule for Laravel's validator or a middleware that validates request bodies, and own the error-shape mapping yourself.Sequencing.
opis/json-schema, validate representative production payloads against the real schemas, measure accuracy and error ergonomics.{path, message, keyword} shape. This is the API your API consumers will see.FormRequest convention, or a middleware for whole-body validation.Maintenance. Adopting the bundle means maintaining a fork or a shim and tracking two upstreams. In the clean-room path you maintain one dependency and your own glue, which is smaller and fully legible to the team. Either way, JSON Schema draft upgrades (e.g., draft-07 → 2019-09) are a recurring cost that no package eliminates.
Support. There is effectively no support channel: 20 stars and 0 dependents implies a single maintainer and a user base too small to have surfaced edge cases publicly. Escalation is "read the source." Budget for that.
Scaling. Validation is CPU-bound and synchronous. OPIS is reasonable, but per-request schema parsing is wasteful — cache compiled schemas in Redis or on disk, and cap payload size before validation runs. Heavy $ref graphs and remote $ref resolution are the usual latency trap; forbid remote refs in production and resolve only from a pinned local schema registry.
Failure modes to design against.
Ramp-up. Low for the concept, moderate for the details. Any engineer can wire a Laravel validation rule in a day; the real learning curve is JSON Schema itself — $ref scoping, additionalProperties, oneOf vs anyOf, and draft-specific keywords. That knowledge is portable and worth building regardless of package choice, which further argues for skipping the bundle and investing in the standard library directly.
How can I help you explore Laravel packages today?