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.
opis/json-schema (a capable, spec-compliant validator). This package is a thin Symfony integration layer — service wiring, configuration, and validation entry points. That reframes the decision from "build a JSON Schema engine" to "spend a day gluing a library into the container," which usually favors buy/adopt with a wrapper.Consider it when:
opis/json-schema directly (or justinrainbow/json-schema) inside a FormRequest or custom rule.opis/json-schema already fits your spec coverage needs (draft-07/2019-09/2020-12 support, $ref resolution, format assertions) and you only need the Symfony wiring.Look elsewhere when:
symfony/serializer denormalization plus assertions, may cover most needs with one fewer dependency.To executives (one paragraph): This is a small, free (MIT) integration that lets our Symfony services validate JSON payloads against a formal schema before the data touches business logic. It does not add a vendor contract or a licensing cost, and it is roughly a day of engineering to adopt. The value is in reducing a class of production bugs and support tickets caused by malformed or unexpected payloads, and in producing API contracts that partners and internal teams can build against. The main caveat is maturity: the project has very low adoption and a single maintainer, so I recommend we adopt the pattern and the underlying validation library while treating this specific bundle as replaceable glue we could own outright.
To engineering: It's a Symfony bundle wrapping opis/json-schema. Thin surface: container wiring plus validation entry points. Two asks before we commit: (1) evaluate whether we get the same outcome with opis/json-schema behind our own small service — that removes the dependency risk entirely and is likely under a day's work; (2) if we do adopt it, pin the version, wrap it behind an internal PayloadValidator interface, and add contract tests so the swap-out cost stays near zero. Do not let JSON Schema documents become the only source of truth for domain types — generate or mirror them in code where the domain model matters.
To partner/support teams: Expect clearer, field-level rejection messages at the API edge instead of opaque 500s downstream, and a published schema we can hand to integrators. That should reduce back-and-forth on "why did my request fail," but only if we invest in surfacing the validator's errors rather than returning a generic 422.
Recommendation: Adopt the approach; evaluate replacing this package with direct use of the underlying library. Revisit if the bundle gains maintainers or meaningful adoption.
How can I help you explore Laravel packages today?