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.
json-mapper/json-mapper into Symfony's service container so services can receive a configured mapper via DI instead of hand-constructing it. The real buy decision is the underlying JsonMapper library; this bundle just removes ~50–150 lines of bootstrap code and a compiler pass.foreach/isset blocks into declarative DTOs. That is a velocity and defect-rate play, not a feature play.composer require json-mapper/json-mapper plus a small factory service is thin — which caps how much political capital it is worth spending.Adopt only when all of the following hold:
JsonMapperInterface autowiring — and you would otherwise write that wiring yourself.Look elsewhere when:
symfony/* version constraint against your current Symfony release before committing; the composer solver is your only source of truth here.#[SerializedName] and denormalization) or cuyz/valinor (typed hydration with validation and excellent error paths) cover more ground with first-party or actively maintained support. If validation-on-hydration matters, Valinor is usually the stronger PM-level answer.Bottom line: this is a convenience wrapper. Consider it, don't standardize on it.
To executives: This is a small, MIT-licensed convenience library that lets our Symfony services turn JSON into typed objects without hand-written parsing code. Cost is near zero and the change is reversible. The caveat is maturity: no measurable community adoption and no release since April 2023, so it should not become critical infrastructure without an internal owner. Recommendation: pilot in one bounded service, measure the reduction in mapping code and payload-parsing bugs, then decide whether to fork it internally or move to a maintained alternative such as Symfony Serializer or Valinor.
To engineering: It auto-registers JsonMapper in the container so you can inject JsonMapperInterface and annotate DTOs instead of writing array-juggling in controllers and message handlers. Typed objects at every boundary means IDE completion, static analysis, and failures that surface at deserialization rather than three layers deep. It is a thin wrapper — if the Symfony constraint breaks, we fork it in an afternoon. Do not adopt it for two DTOs; just instantiate the mapper.
How can I help you explore Laravel packages today?