speakeasy/serializer
Speakeasy Serializer is a Laravel/PHP package for converting models and data into consistent serialized output. It provides a straightforward way to define reusable serialization logic, making it easier to shape API responses and keep data transformations organized.
What this artifact actually is: a vendor-maintained stopgap fork of JMS Serializer, published by Speakeasy (an SDK-generation company) to unblock generated PHP SDKs while serialization fixes work their way upstream. It is not a product in its own right — effectively zero stars, zero dependents, and a release history that until now amounted to a single cut. Treat it as an implementation detail of someone else's codegen pipeline, not a library you adopt on merits.
What changed in v3.40.0: the fork shipped feature work rather than a pure rebase — "Required Properties" and "skipIfNull." Both sit squarely on the contract-fidelity axis that matters for API products, which is why this release is worth a paragraph in the decision record rather than a version bump and a shrug.
Decisions it informs:
skipIfNull is not a cosmetic flag. It decides whether a null field is omitted or emitted as null, and downstream consumers routinely distinguish the two — PATCH/merge-patch semantics, tri-state form updates, and "no change" vs. "clear this value." If your roadmap has partial-update endpoints, this is a contract decision that outlives the package.fromArray/toArray mappers are cheap for three DTOs and ruinous for three hundred. If your roadmap includes many endpoints, generated SDKs, or partner-facing clients, a metadata-driven serializer is a buy decision — and the buy is JMS Serializer upstream, not this fork.null may begin throwing. That is a silent breaking change for anyone floating a version constraint. Confirm the default when required is unset before rolling forward.Consider it only when:
Look elsewhere when:
symfony/serializer (already present in most Symfony stacks, lower ceremony).Sizing note: the moderate opportunity signal reflects broad ecosystem demand for PHP serialization tooling — a real category. It does not validate this specific artifact, whose adoption signal is effectively nil. Don't let category appetite justify artifact selection.
For executives (30 seconds): This is a temporary fork of a well-established PHP serialization library, published by a code-generation vendor to unblock their generated SDKs. It is MIT-licensed and safe to use, but it has no independent community, no dependents, and a minimal release history — so we should not standardize on it. The newest release adds two behaviors that affect how our API payloads look on the wire (required-field enforcement and whether null fields are omitted), which means generated clients may now depend on behavior the mainstream library doesn't have. Recommendation: treat it as a pinned, disposable dependency, permitted only inside vendor-generated code, with a funded plan to migrate back to upstream and a payload-compatibility test to prove the swap is safe. Cost is small and time-boxed; the risk of ignoring it is silent serialization bugs in generated clients.
For engineering: this is a stopgap, not a strategic dependency, and v3.40.0 makes that distinction more important rather than less. Three rules if we take it on. First, isolate it — no hand-written application code imports it directly; all (de)serialization goes through our own thin facade, so the swap back to upstream JMS Serializer is a one-file change. Second, pin and watch — exact version in composer.lock, an owner assigned, and a standing ticket to re-evaluate against upstream on every JMS Serializer release. Third, as of v3.40.0, verify provenance and behavior — determine whether skipIfNull and required-property handling come from upstream or are fork-only, and write characterization tests for absent-vs-null payload shape and for missing-required-field failure mode before we ship anything that relies on them. Document why the fork is needed (which specific upstream change we're waiting on); if we can't name it, we probably don't need the fork.
What we're explicitly not claiming: that this package is a competitive option in the PHP serialization space. It isn't trying to be. The strategic decision is which serializer our product standardizes on — that should be upstream JMS Serializer or symfony/serializer, evaluated on contract fidelity, maintenance, and migration cost. This fork is a routing detail on the way there, and it should remain temporary by design. If v3.40.0's features never land upstream, that "temporary" assumption expires and we should re-open the decision rather than drift into permanent fork ownership.
How can I help you explore Laravel packages today?