The Symfony Serializer component design is based on the chain-of-responsibility pattern. That makes it hard to know which normalizers and encoders are used during the entire (de)serialization process.
That's why in Symfony 6.1 we've added a new Serializer panel in the Symfony Profiler:
This feature decorates the serializer
service to trace the activity of the
serialize()
, deserialize()
, normalize()
, denormalize()
,
encode()
and decode()
methods calls. All normalizers and encoders are
decorated as well, so you'll get the full details and total duration of all
(de)serialization steps.
You don't need to add or configure anything to enjoy this feature. Just update your project to Symfony 6.1 and you'll get the new debugging information in the Symfony profiler.
Thank you Mathias!
good idea! thanks
Thanks, this new panel will improve DX by avoiding time to dig which normalizers and encoders were used.
Good addition to the profiler. Great work!
Serializer profiling may be disabled after upgrading Symfony to 6.1. Set value of confiuration
framework.profiler.collect_serializer_data
totrue