From 3e9af1bc2be7b51b474a1c2d92c3d74b81a4aa37 Mon Sep 17 00:00:00 2001 From: Mathias Arlaud Date: Tue, 22 Aug 2023 08:59:05 +0200 Subject: [PATCH] [Serializer] Use NormalizerInterface instead of ObjectNormalizer --- serializer/custom_normalizer.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/serializer/custom_normalizer.rst b/serializer/custom_normalizer.rst index 5b70acecdb5..f3c099e6466 100644 --- a/serializer/custom_normalizer.rst +++ b/serializer/custom_normalizer.rst @@ -48,6 +48,15 @@ to customize the normalized data. To do that, leverage the ``ObjectNormalizer``: } } +.. deprecated:: 6.1 + + Injecting an ``ObjectNormalizer`` in your custom normalizer is deprecated + since Symfony 6.1. Implement the + :class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizerAwareInterface` + and use the + :class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizerAwareTrait` instead + to inject the ``$normalizer`` property. + Registering it in your Application ----------------------------------