diff --git a/serializer/custom_normalizer.rst b/serializer/custom_normalizer.rst
index 33389b5c4d4..5c2ba5a385e 100644
--- a/serializer/custom_normalizer.rst
+++ b/serializer/custom_normalizer.rst
@@ -17,9 +17,9 @@ process. For that you'll have to create your own normalizer. But it's usually
preferable to let Symfony normalize the object, then hook into the normalization
to customize the normalized data. To do that, leverage the ``ObjectNormalizer``::
- namespace AppBundle\Serializer;
+ namespace App\Serializer;
- use AppBundle\Entity\Topic;
+ use App\Entity\Topic;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
@@ -53,45 +53,15 @@ to customize the normalized data. To do that, leverage the ``ObjectNormalizer``:
}
}
-Registering it in Your Application
-----------------------------------
-
-In order to enable the normalizer in an application based on the entire Symfony
-framework, you must register it as a service and :doc:`tag it `
-with ``serializer.normalizer``.
-
-.. configuration-block::
-
- .. code-block:: yaml
- # app/config/services.yml
- services:
- app.yaml_encoder:
- class: AppBundle\Serializer\TopicNormalizer
- tags:
- - { name: serializer.normalizer }
-
- .. code-block:: xml
-
-
-
-
-
-
-
-
-
-
-
+Registering it in your Application
+----------------------------------
- .. code-block:: php
+If you use the Symfony Framework. then you probably want to register this normalizer
+as a service in your app. If you're using the :ref:`default services.yml configuration `,
+that's done automatically!
- // app/config/services.php
- use AppBundle\Serializer\TopicNormalizer;
+.. tip::
- $container
- ->register('app.yaml_encoder', TopicNormalizer::class)
- ->addTag('serializer.normalizer')
- ;
+ If you're not using autoconfigure, make sure to register your class as a service
+ and tag it with ``serializer.normalizer``.