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

Symfony Bundle Laravel Package

json-mapper/symfony-bundle

Symfony bundle that integrates JSON Mapper into your Symfony application, providing service configuration and dependency injection for mapping JSON data to PHP objects. Simplifies setup so you can configure mappers and use them via the container.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This package is a Symfony bundle, not a Laravel package. Its entire surface area is Symfony DependencyInjection glue: a Bundle subclass, service definitions wiring JsonMapperInterface to a configured JsonMapper instance, and configuration tree handling for middlewares. None of that executes under Laravel's container. For a Laravel stack, the relevant artifact is the underlying json-mapper/json-mapper core library, which is framework-agnostic and usable directly. The bundle is best treated as a reference implementation of the DI wiring pattern, not as an installable dependency.

Integration feasibility. Low for the bundle itself (incompatible container, pulls symfony/http-kernel and symfony/dependency-injection transitively). High for the core library: registering a singleton JsonMapper in a Laravel service provider and binding an interface alias is roughly 30–50 lines. The real integration work is not code, it is convention-setting: which DTOs are mappable, how attributes are declared, and where mapping happens in the request/response lifecycle.

Technical risk. Mixed but manageable. Release 2.2.1 (2023-04-04) is the only release in the review window and it is a transitive-dependency security constraint bump resolving CVE-2022-24894 (a Symfony http-kernel/HTTP-cache advisory). There is no API change, no configuration change, no new feature, and no deprecation — the bundle's own code is untouched. It therefore does not change the recommendation, and it clarifies the earlier read: the repo's sole maintenance activity since 2023 has been dependency hygiene, not development. Two secondary signals follow. First, the bundle carries its own inherited vulnerability surface — installing it means inheriting Symfony's CVE cadence alongside it, which the core-library-only approach avoids entirely. Second, responsiveness is modest: the upstream advisory was patched in Symfony in early 2023 and the constraint bump landed roughly two months later, in a repo with zero stars and zero dependents. Fine for a read-only reference, a red flag if it were ever a dependency. The core library still carries the substantive risk: attribute-based reflection mapping is a schema-coupling point, and any drift between JSON payload shape and DTO annotations surfaces as runtime MappingException rather than at compile or validation time.

Key questions before committing.

  • Is the core json-mapper/json-mapper library actively released, and does it support the PHP version on our deployment target?
  • Do we need middleware features (DateTime handling, case conversion, null handling) that the core config supports, and can we express that configuration in a Laravel config file equivalently?
  • Is the team's real need JSON→DTO hydration, or schema validation? If validation is in scope, this library does not do it and we should not pretend it does.
  • Would spatie/laravel-data, symfony/serializer, or plain Laravel FormRequests already cover the use case with less bespoke glue?
  • Does any team have the Symfony bundle in a composer.json today, left over from a port or a PoC? If so, that lockfile needs an audit against this CVE before anything else happens.
  • Who owns the wrapper provider internally when the upstream bundle is not a dependency we can lean on?

Integration Approach

Stack fit. Use the core library; do not install the Symfony bundle. Laravel 10/11 on PHP 8.1/8.2 aligns with the attribute-based mapping model. The bundle's architectural contribution — a configured singleton plus interface binding — translates cleanly to a Laravel service provider.

Migration path. If porting from a Symfony service that already consumes JsonMapperInterface: lift the middleware list and any class-map configuration out of Symfony YAML/XML into a config/json-mapper.php file, instantiate JsonMapper via JsonMapperBuilder in the provider, and bind the interface to that singleton. Consumers keep injecting the interface, so call-site churn is near zero. If starting fresh, skip the port entirely and write the provider against the core API. For teams using the bundle as a reference implementation, note that 2.2.1 narrows its symfony/* constraints to patched versions — copy the wiring pattern, not the composer.json.

Compatibility. Watch three boundaries: PHP version floor of the core library, the symfony/* constraint set if anything else in the app pulls Symfony components (console, process), and attribute support in the runtime. Because the bundle will not be installed, its Symfony constraints — now stricter after 2.2.1 — cannot poison the dependency graph. That remains a deliberate benefit of the core-only approach.

Sequencing.

  1. Spike: map two or three real payload shapes with the core library in a scratch branch; measure whether attribute conventions are ergonomic for the team.
  2. Build the provider and config file; bind interface alias; add a container test.
  3. Establish DTO conventions and a documented example; decide error-handling policy for mapping failures.
  4. Introduce mapping at one boundary (e.g., an inbound webhook or third-party API client) before broadening.
  5. Only then consider adopting for outbound serialization or persistence boundaries.

Operational Impact

Maintenance. You own the glue — a small provider, a config file, and convention docs. Budget a few days initially and a low recurring cost. The dependency to monitor is the core library, not this bundle; pin it and review on PHP upgrades since reflection-and-attributes libraries are sensitive to language changes. Do not depend on the bundle for updates: 2.2.1 is a dependency-hygiene patch, not evidence of feature maintenance, and should not be read as a renewal of upstream investment.

Support. No vendor, no SLA, GitHub-issues-only. Realistic expectation is self-support with upstream fixes arriving only if the core maintainers care about the issue. Security posture is constraint-bump-only — there is no indication of backports to older branches — so anyone who did install the bundle must track latest. For a low-criticality mapping layer this is acceptable; for a payment or compliance boundary it is not.

Scaling. Mapping is CPU-bound reflection. At high throughput (bulk imports, high-QPS ingestion), metadata reflection becomes measurable, so plan to cache mapper metadata or reuse a single mapper instance rather than constructing per call. Memory profile is fine; the risk is latency under volume, not footprint.

Failure modes.

  • Schema drift: upstream adds, renames, or nulls a field → MappingException or silently null DTO properties. Decide explicitly between strict failure and lenient defaults.
  • Type coercion: numeric strings, empty strings vs null, and boolean-ish values are classic mismatch sources; codify expected behavior in tests.
  • DateTime and timezone handling: middleware configuration is the only control point; get it right once and test it.
  • Attribute drift: a DTO without required mapping metadata fails only at runtime, so add contract tests per DTO.
  • Inherited transitive vulnerability: if the bundle is installed, its symfony/http-kernel floor becomes a security concern, not just a conflict concern. Verify the patched constraint range in any environment where it already exists.
  • Hidden coupling: mapping logic spread across controllers makes failures hard to trace; centralize.

Ramp-up. Low for engineers familiar with attributes and DTO patterns; a half-day of onboarding plus one worked example is typically enough. The larger organizational cost is convention discipline — without a documented DTO standard, teams will invent inconsistent mapping styles and the error surface will fragment. Given the package's near-zero adoption signals and patch-only release history, position this as an internal, self-owned utility layer built on a small upstream library, not as a community-supported dependency.

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