mhujer/jms-serializer-uuid-bundle
Symfony bundle that integrates ramsey/uuid with JMS Serializer, registering handlers to serialize and deserialize UUID objects—including uuid-doctrine types—so your JSON APIs handle UUIDs cleanly without custom visitors.
What the package actually is. mhujer/jms-serializer-uuid-bundle is a Symfony bundle that registers a JMS Serializer handler so Ramsey\Uuid objects serialize to/from their canonical string form in JSON/XML payloads. The functional surface area is small: one handler implementing SubscribingHandlerInterface, one DI extension, and a service definition. There is no business logic, no persistence layer, and no runtime infrastructure.
Architecture fit — the framing is wrong. The brief describes this as a Laravel/PHP package; it is a Symfony bundle and always was. Under a Laravel stack, the bundle wiring (Bundle class, DependencyInjection\Extension, services.xml, compiler pass) is inert and unusable — only the handler class is portable, and that class is on the order of tens of lines. Under a Symfony stack the conceptual fit is correct, but the bundle targets the Symfony 2.7/3.0 and jms/serializer ~1.x era. Either way, the decision is not "adopt a package," it is "treat this repository as a reference implementation and own the code."
Integration feasibility — high, because the work is a rewrite, not an install. A TPM should frame this as a 1–3 dev-day engineering task with a clear acceptance test, not a dependency evaluation. The team must decide (a) which UUID library and version is canonical, (b) the canonical wire format, and (c) whether JMS Serializer is required at all — in Laravel, an Eloquent cast plus an API Resource typically removes the need for a JMS handler entirely.
Technical risk — severe as a dependency, low as source material.
ramsey/uuid moved from static Uuid::uuid4() factories to UuidInterface and Uuid::fromString() with relocated exception classes across 2.x → 4.x.jms/serializer ^3 / ramsey/uuid ^4 without modification, so "integration" and "fork" are the same work item.Key questions to resolve before committing.
Uid normalizer instead."urn:uuid: prefixed, compact, or nil-UUID?Stack fit and recommended path. There are three viable paths, in descending order of preference:
| Path | When it applies | Effort |
|---|---|---|
Drop JMS for UUIDs; use native casts / Symfony Uid normalizer |
Greenfield, or JMS not already load-bearing | 0.5–1 day |
| Vendor the handler into the app, register it ourselves | JMS Serializer is an existing, load-bearing dependency | 1–2 days |
| Install the bundle as-is | Symfony 2.x/3.x application frozen on legacy PHP | Not recommended |
For a Laravel application, path 1 or 2. Do not add mhujer/jms-serializer-uuid-bundle to composer.json — a 2016 Symfony bundle will fail composer install against a modern PHP constraint and, once patched into compatibility, becomes an unowned fork inside vendor/ that the next composer update silently reverts.
Compatibility targets to design against. PHP 8.1+, jms/serializer ^3.x, ramsey/uuid ^4.x. The original code presumes PHP 5.5–7.0, Symfony 2.7/3.0, jms/serializer ~1.0, and ramsey/uuid ~2.8/3.0 — assume every import statement, every handler signature, and every exception type needs to change. Budget for the rewrite, not a patch.
Migration path (sequenced).
vendor/ path remains.Sequencing note. Steps 1 and 2 are the schedule risk, not step 3. The code is trivial to write; discovering that three downstream consumers depend on uppercase-braced UUIDs is not. Front-load the audit.
Maintenance. Zero upstream. The repository is archived, so there is no issue tracker, no PR review, no release cadence, and no security response process. Any security finding in the copied code becomes an internal ticket with no upstream escalation path. MIT license means this is acceptable if the code is vendored under application ownership with an internal owner named — it is not acceptable as a transitive dependency in composer.json.
Support and supply chain. 0 dependents and 12 stars is a strong negative signal: no one has stress-tested this against modern stacks, and there is no community to triage a compatibility issue. Treat the repository as untrusted third-party source — read every line before copying (feasible here, given the size) and record provenance in the repo for future auditors.
Scaling characteristics. Effectively a non-issue. The handler is invoked once per UUID field per payload, does a string conversion, and holds no state. It will not appear in a profile. The operational risk here is entirely correctness and compatibility, not throughput.
Failure modes to instrument and test against.
urn:uuid: prefix, and nil UUID are all plausible variants. A producer emitting different casing than a consumer expects creates intermittent, hard-to-reproduce mismatches. Mitigation: normalize to a single canonical form at the boundary and reject anything else loudly.Ramp-up. The handler itself takes a mid-level engineer one to two hours to understand and rewrite. The real ramp-up cost is organizational: whoever owns it must understand JMS Serializer's handler and graph-navigator model well enough to debug a registration failure, which is a distinctly non-obvious failure mode for engineers who have only used Eloquent casts. Budget a half-day of spike work if the team is new to JMS.
Bottom line for the roadmap. Do not adopt. Vendor or reimplement, target PHP 8.1+ / ramsey/uuid ^4 / jms/serializer ^3, and only if JMS Serializer is already load-bearing. If JMS Serializer is being introduced for this purpose alone, eliminate the dependency instead — the package's only real contribution is a few dozen lines of string conversion that the application should own outright.
How can I help you explore Laravel packages today?