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 Request Bundle Laravel Package

flying-narwhal/json-request-bundle

Symfony bundle that decodes JSON request bodies into Symfony's request parameter bag, letting controllers read JSON payloads through the usual $request->request API without custom parsing.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit — poor for a Laravel codebase, and that is the decisive finding. Despite being catalogued here as a "Laravel/PHP package," flying-narwhal/json-request-bundle is a Symfony bundle. It ships a Bundle subclass plus a DI extension and a kernel.request event listener — none of which Laravel has a registration mechanism for. Laravel consumes Symfony components (HttpFoundation, Console, Process, VarDumper) but has no bundle/kernel-bundle discovery layer, so there is no supported install path. Even a composer require would produce an inert package that never bootstraps.

More importantly, the capability it exists to provide is already native in Laravel and has been for years. Symfony historically required a listener to promote a JSON body into the request parameter bag so that Form/Validator components could see it. Laravel's Illuminate\Http\Request transparently merges JSON payloads into input()/all(), exposes $request->json(), and FormRequest validation reads from it without ceremony. The package's core value proposition is a no-op on Laravel.

Integration feasibility — low. Signals that matter: 6 stars, 0 dependents, composite score 0.27. Zero dependents is the strongest available proxy that nobody has run this in a production dependency graph. For a bundle whose entire surface is a kernel event listener, the risk of subtle ordering conflicts with other kernel.request listeners is non-trivial and would be discovered only in integration.

Technical risk — high, concentrated in four areas:

  • Supply chain / bus factor. Single-maintainer, negligible adoption, no evidence of a security policy or advisory channel. Adding this to a dependency graph expands attack surface for near-zero functional gain.
  • Framework version drift. Symfony's bundle conventions and event dispatcher have churned across 4/5/6/7. Unsure which constraints are supported; an out-of-date bundle can pin transitive Symfony packages and collide with the host app.
  • Semantics of the parameter bag write. Decoding JSON into $request->request blurs the distinction between query, body, and header inputs. If the listener overwrites rather than merges, or merges with the wrong precedence, validation can silently pass on attacker-supplied or empty fields — a class of bug that is invisible in happy-path testing.
  • Failure mode on malformed JSON. If the listener swallows a json_decode failure and leaves the bag empty, downstream validation sees a request with no fields rather than an error, and the client gets a confusing 422 instead of a 400.

Key questions for the maintainer / code audit:

  1. Which Symfony and PHP version ranges are declared, and are they still receiving security patches?
  2. Does the listener merge or replace existing request parameters, and at what kernel.request priority?
  3. What is the behavior on malformed JSON, an empty body, or a mismatched Content-Type?
  4. Is there CI, a test suite, or a tagged release history? Is there a SECURITY.md?
  5. Is the listener's logic small enough to reimplement as a Laravel middleware (likely 50–100 lines) rather than vendor?
  6. Who is the accountable owner if this breaks — and what is the exit?

Integration Approach

Stack fit. Two distinct cases, and the answer diverges sharply:

  • Laravel host (likely). Do not integrate. Use $request->json()->all(), $request->input(), and FormRequest rules with json payload assertions. If a middleware shim is genuinely needed for a legacy client contract, write a ~60-line ConvertJsonRequest middleware in-house with $request->merge() on isJson() and an explicit 400 on decode failure.
  • Symfony host. Only then is this package name-coherent — and even then, evaluate against symfony/http-foundation's Request::toArray() and the first-party symfony/serializer deserialization path before adding a third-party bundle.

Migration path. Treat this as build, not adopt. The migration is not "install and configure"; it is "reproduce the intended behavior under test." Sequence: extract the listener's semantics by reading the source, encode those semantics as a Laravel middleware + feature tests, and ship. This converts an unmaintained third-party dependency into owned, tested, ~100-line code with an obvious owner.

Compatibility. If a Symfony use case is confirmed, pin the bundle to an exact version, check that its Symfony constraints resolve against the host's composer.lock without upgrading framework packages, and verify no other kernel.request listener depends on the parameter bag being empty. Do not allow a floating ^ constraint on a 6-star package.

Sequencing.

  1. Confirm the actual framework of the target service (this assessment's premise appears wrong).
  2. If Laravel: close the ticket as "no integration required — native capability," document the decision.
  3. If a shim is needed: write middleware, add contract tests covering malformed JSON, empty body, wrong content type, nested objects, and Content-Type charset variants.
  4. If Symfony: vendor/fork the bundle, pin it, add the same contract tests.
  5. Record an ADR with the exit criterion so the next reviewer does not re-litigate.

Operational Impact

Maintenance. Effectively unmaintained. With 0 dependents and 6 stars there is no community pressure to keep it current against Symfony releases, no issue triage, and no patch cadence. The MIT license is the saving grace — forking and absorbing the code is legally clean, and given the small surface area, that is the only defensible production posture.

Support. No vendor, no commercial backing, no ecosystem answers. Any incident is debugged from source by whoever is on call. Budget for that explicitly rather than assuming StackOverflow coverage exists.

Scaling. Runtime cost is negligible — a single json_decode per request, linear in payload size. The real scaling concern is memory and latency on large bodies: decoding before routing or auth means unauthenticated clients can force allocation. Enforce a body-size limit at the edge (nginx/ALB) regardless of whether the package is used.

Failure modes to instrument:

  • Malformed JSON → empty parameter bag → validation passes on a request that should have been a 400. Add an assertion that the bag is non-empty when Content-Type: application/json.
  • Overwrite-vs-merge precedence bugs letting body fields shadow route or query parameters.
  • Listener ordering conflicts producing order-dependent behavior that reproduces only in full-stack integration.
  • Framework upgrade breaking the bundle with no upstream fix; mitigate with a fork + pinned constraint.
  • Silent divergence between environments if the listener is registered conditionally.

Ramp-up. Low to learn, but knowledge concentration is the risk: the behavior lives in undocumented event-listener semantics, so the person who audits it becomes the single point of knowledge. If adopted, the contract tests are the documentation — invest there and keep them in the main test suite rather than a separate one.

Recommendation. Given a score of 0.27, zero dependents, and a framework-model mismatch with Laravel, the expected value of adoption is negative. The opportunity signal (16.79) reflects a market gap in Symfony JSON-body ergonomics, not an actionable Laravel opportunity — that gap is already closed in the framework itself. Close as "not applicable," or ship owned middleware if a concrete client contract demands it.

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.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels