Library / SDK
schmittjoh/serializer avatar
schmittjoh/serializer

jms/serializer converts PHP object graphs to JSON and XML, and only 3.x still gets fixes

Library for (de-)serializing data of any complexity (supports JSON, and XML)

2,341 stars587 forksPHPMIT

At a glance

What is it?
A PHP library for turning objects of any complexity into JSON or XML and back, with Doctrine integration, API versioning and metadata from XML, YAML or annotations. Only the 3.x line is supported.
Who is it for?
jms/serializer fits a PHP project that must map object graphs to JSON or XML and needs versioned output or metadata kept in annotations, XML or YAML. It does not fit anyone who needs a format beyond those two, or who is still on 1.x or 2.x, since neither line has received fixes for years.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 12 days ago.
What is it written in?
Mainly PHP, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 9, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • schmittjoh/serializer2,341 ★ · +0
Star history
Repository2026-10-142026-11-09
schmittjoh/serializer2.3k2.3k

0 Stars in the last 26 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Object graphs in, JSON or XML out, with no other formats

jms/serializer is a PHP library that serializes and deserializes data of any complexity. The formats it supports today are XML and JSON, and the project text says exactly that: currently XML and JSON. If your API also needs another wire format, this library does not cover it.

The pitch goes beyond a plain encoder. The library calls itself a rich tool-set for adapting the output to your needs. In practice that means you describe how each class maps to the document instead of getting a one-to-one dump of every property. Circular references and complex exclusion strategies are handled gracefully, which matters for object graphs where an order points to a customer and the customer points back to the order.

The repository is MIT licensed, written in PHP, and published on Packagist as jms/serializer. The default branch is master and it carries the 3.x code.

Built-in PHP types and Doctrine ORM are covered without custom code

Two items on the feature list save you from writing handlers for common cases. The first is a set of built-in PHP types, with dates and intervals named as examples. A DateTime property or a DateInterval does not need a hand-written converter before it can appear in a payload.

The second is integration with Doctrine ORM and similar libraries (the project writes et. al. and names no others). Entities loaded through an ORM are the usual place where serializers run into proxies and lazy collections, so a stated integration is a reason to try the library on a Doctrine-based application first.

What the feature list does not give you is detail. It names no Doctrine version, no list of supported ORMs beyond Doctrine, and no table of every built-in type. Those answers live in the linked documentation at jmsyst.com/libs/serializer. Treat the bullet points as a pointer to where to look, and check your own entity classes against the docs before you commit to the library.

Output versioning for APIs is part of the library

Supporting versioning, for example for APIs, is listed among the built-in features. The idea is that the same class can produce different documents depending on which version of your API a client asked for. A field introduced in a later API version can stay out of responses to older clients without a second set of classes.

The feature list stops at that one line. It does not say how the version is passed in, whether it applies per property or per class, or what happens to fields removed in a later version. Those are questions for the documentation site and the tests directory.

Versioning is a useful reason to pick this library when you maintain a public API with clients you cannot upgrade. It is a poor reason if your API has a single consumer you control, since plain code changes and a deploy are simpler than carrying version annotations around.

Metadata comes from XML, YAML or annotations, so the choice is yours to make

The library is configurable via XML, YAML or Annotations. That is three places to declare how a class is serialized: next to the code in annotations, or in separate XML or YAML files that leave the class itself untouched.

Separate files help when the class belongs to a third-party package or when you want domain classes free of serializer markup. Annotations keep the mapping next to the property it describes, which is easier to review in a pull request.

The cost of three options is that a team must pick one and stay with it. Mixed styles across a codebase make it harder to find where a field's name or exclusion rule is defined. The project text does not say which style the maintainers prefer or how the three combine when more than one is present, so settle that rule in your own conventions before the mappings multiply.

Only 3.x is supported, and 1.x and 2.x stopped getting fixes years ago

The README states that master carries the 3.x version and that 3.x is the supported one. The 1.x and 2.x branches have no further feature releases. Security issues for them were to be fixed until 1 January 2020, and only critical bugs might have received fixes until 1 September 2019.

An application still on 1.x or 2.x is therefore running code the maintainers consider closed. The route out is the UPGRADING.md file in the repository, which holds the instructions for moving to 3.x. A CHANGELOG.md sits next to it for release-by-release detail.

The 3.x line itself is moving. The recent releases are 3.32.9 on 2026-09-04, 3.32.8 on 2026-08-31 and 3.32.7 on 2026-03-19, and the last push to the repository was on 2026-10-25. The repository is not archived. Version numbers in the 3.32 range tell you that 3.x has seen a long run of minor releases, so read the changelog between your current version and the latest before bumping.

The README contains no install command and no usage code

Anyone expecting a composer line and a five-line example will not find one in the repository README. It holds an introduction, the feature list, the version notes and a support section. Beyond the Packagist badge linking to jms/serializer, it gives no install command, so this article shows none.

The real instructions sit in two places. The first is the documentation site at jmsyst.com/libs/serializer, which the README points to for learning more. The second is the repository itself, which has a doc/ directory, a tests/ directory with the PHPUnit configuration in phpunit.xml.dist, and a phpbench.json for benchmarks.

The tooling files show how the project guards its own quality: phpcs.xml.dist for coding standards, phpstan.neon.dist with a phpstan/ folder for static analysis, and rector.php for automated refactoring. There is also a SECURITY.md and a CONTRIBUTING.md. None of those files were published with numbers, so the repository gives no benchmark results to cite.

Paid support exists by email, and the library has no hosted service

A Professional Support section in the README says paid support is available by writing an email to the address listed there. Nothing else is stated: no price, no response time, no scope. If you need a contract for a production system, that email is the only route the project documents.

For everything else the channels are the ones on GitHub: the issue tracker, the CONTRIBUTING.md guide and SECURITY.md for reporting vulnerabilities. The README does not mention a chat room or a forum.

This is a library you install into a PHP application, so there is no service to host and no account to create. The decision comes down to whether the two supported formats and the metadata options fit your project, and whether you are willing to read the external documentation because the repository README will not teach you the API.

Editorial conclusion

jms/serializer fits a PHP project that must map object graphs to JSON or XML and needs versioned output or metadata kept in annotations, XML or YAML. It does not fit anyone who needs a format beyond those two, or who is still on 1.x or 2.x, since neither line has received fixes for years. Before adopting it, open UPGRADING.md and the documentation on jmsyst.com, because the repository README carries no usage code at all and you will learn the API from the docs and the tests directory.

Frequently asked questions

Which formats does jms/serializer support?

It currently supports XML and JSON. The project text names no other format.

Is jms/serializer 2.x still supported?

No. Only 3.x is supported, on the master branch. For 1.x and 2.x, security issues were fixed until 1 January 2020 and only critical bugs might have been fixed until 1 September 2019.

How do I configure jms/serializer mappings?

The library is configurable via XML, YAML or Annotations. The documentation at jmsyst.com/libs/serializer covers the details.

Official sources

  1. License: MIT
  2. Project website
  3. README
  4. Releases
  5. schmittjoh/serializer on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/schmittjoh-serializer.svg)](https://hysenlabs.com/projects/schmittjoh-serializer)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/schmittjoh-serializer.svg)](https://hysenlabs.com/projects/schmittjoh-serializer)

Was this useful?