JsonMapper maps JSON data to PHP classes through a chain of middleware that you arrange to suit your own models. These pages cover installing it, the middleware it ships with, and how to extend it.
New here? Start with Getting started, which walks through mapping a first response end to end.
These pages describe JsonMapper 2.25.1, which requires PHP 7.4 or higher. Anything added during the 2.x line carries an "Available since" line naming the release that introduced it; everything else has been there since 2.0.
Where to look#
- Installation and Setup — add the package to your project and create a mapper instance.
- Architecture — how the middleware chain fits together. Worth reading before writing your own.
- Guides — end-to-end walkthroughs, including creating middleware and using JsonMapper with Laravel or Symfony.
- Middleware — a page per middleware, from typed properties and DocBlock annotations through to renaming and value transformation.
- Advanced Usage — performance, casting values, and mapping to interfaces and abstract classes.
Every page has an "Edit Source" link if you spot something worth improving.