sunmediatv/json-request-bundle
A Symfony bundle for handling JSON HTTP requests, helping map JSON payloads to structured data and integrate request parsing more cleanly in controllers. Useful for APIs that need consistent, reusable JSON request handling.
Framework mismatch first: sunmediatv/json-request-bundle is a Symfony bundle, not a Laravel package. It targets Symfony's HttpKernel (argument resolvers / param converters) and Validator. You cannot composer require it into a Laravel app and have it "just work" — there is no ServiceProvider, no facade, no config/*.php.
In a Symfony app:
composer require sunmediatv/json-request-bundleSunMediaTv\JsonRequestBundle\JsonRequestBundle in config/bundles.phpDependencyInjection/*Extension.php and its argument resolver / param converter first — the README on a 0-star repo is often stale.POST /api/widgets endpoint where the controller typehints a DTO. The bundle deserializes php://input and hands you a validated object.If you're on Symfony ≥ 6.3, use native #[MapRequestPayload] instead — same outcome, maintained.
In Laravel, the honest path is to vendor the DTOs + constraints and deserialize yourself (see Implementation Patterns).
symfony/validator constraints. Annotate properties with #[NotBlank], #[Length], #[Type], etc. The bundle's job is to serialize the JSON into the DTO and then run the validator — if you skip constraints you just get a hydrated object with no safety.symfony/serializer (or spatie/data-transfer-object) in a FormRequest::prepareForValidation().symfony/validator — pick one and stay consistent.422 for validation failures, 400 for malformed JSON.Content-Type, (c) empty body, (d) each validation rule violation.application/json. A missing header yields a silent 415/400 — the most common "it just doesn't fire" bug.Default group only; scoped rules may not be exposed by the bundle's config.config/services.yaml with decorates:. Inspect Resources/config/services.yaml inside the bundle to see what's decoratable.dump($request->getContent()) → confirm Content-Type → confirm the controller typehint matches a registered resolver. That resolves ~90% of issues.FormRequest + symfony/serializer or a maintained DTO package gets you the same ergonomics without the unmaintained-Symfony-bundle baggage. For Symfony apps, use native #[MapRequestPayload].How can I help you explore Laravel packages today?