qandidate/symfony-json-request-transformer
Symfony package that decodes JSON request bodies into standard request parameters, so forms, validation, and controllers handle JSON APIs without custom parsing. A lightweight request transformer for cleaner Symfony JSON endpoints.
Request::toArray(), #[MapRequestPayload], improved json request format handling). Its archived status is a concrete data point for prioritising a Symfony 5.x → 6.3+/7.x upgrade: the upgrade removes a dependency rather than adding one.kernel.request: check Content-Type: application/json, json_decode the body, replace the request parameter bag, return 400 on parse failure. For a PM, this is a "delete/buy-nothing" case, not a procurement case — the decision is whether to own a small internal listener or carry an unmaintained vendor package.Illuminate\Http\Request already merges JSON bodies into the input source via $request->json() / $request->all(). This package is therefore redundant in Laravel — flagging it in a Laravel backlog is a sign of copy-pasted research, and the PM should redirect the team to native request handling and FormRequests.Content-Type, and empty bodies are handled (400 vs. 415 vs. silent empty array) are product-visible API behaviours, not just plumbing. This package makes an implicit choice; your API style guide should make it explicitly.Consider it only when all of the following hold:
$request->request so that existing controllers, form types, or ParamConverters keep working without per-action changes.src/, add tests, and pin the commit. Do not depend on the upstream repo.Look elsewhere when:
$request->json(), $request->input(), and FormRequests already cover this. No package needed.#[MapRequestPayload] with the Serializer and Validator — you get typed DTOs and validation errors for free, which is the actual product value.For executives (one paragraph): A team member has proposed adding a small third-party library to handle JSON request bodies. My recommendation is not to adopt it. It is an archived, single-purpose Symfony listener (last release January 2023, no downstream dependents) that does roughly a hundred lines of work our own engineers can own outright — and in our Laravel services it duplicates behaviour we already get for free. The strategic move it points to is a framework upgrade: modern Symfony handles typed JSON payloads natively, which removes this dependency and an entire class of "body came through empty" bugs. Cost of the alternative is low; cost of carrying an unmaintained package in a payment- or customer-facing path is not.
For engineering (the ask):
qandidate/symfony-json-request-transformer as a Composer dependency.kernel.request with priority above the router (>32), covering: Content-Type check, json_decode with error handling mapped to HTTP 400, and a documented merge policy into the request bag. Ship it with unit tests and a code comment linking the removal ticket.$request->json() / FormRequests already do this. Add a line to the API style guide so nobody re-raises it.#[MapRequestPayload] + Serializer/Validator on the roadmap; treat the custom listener as temporary scaffolding.Success criteria for the PM: the JSON-body bug class stops appearing in triage, no new third-party dependency enters the SBOM, and the removal of any temporary listener is tracked to a dated milestone rather than left open-ended.
How can I help you explore Laravel packages today?