From 9ed468d5cd88c574528f8fe949273fed84a55f6f Mon Sep 17 00:00:00 2001 From: YaFou <33806646+YaFou@users.noreply.github.com> Date: Mon, 22 Jun 2020 18:41:41 +0200 Subject: [PATCH] [Serializer] Adds FormErrorNormalizer --- components/serializer.rst | 6 ++++++ serializer.rst | 3 +++ serializer/normalizers.rst | 3 +++ 3 files changed, 12 insertions(+) diff --git a/components/serializer.rst b/components/serializer.rst index 19de72afaba..cdc27458e7e 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -731,6 +731,12 @@ There are several types of normalizers available: This normalizer converts :phpclass:`DateInterval` objects into strings. By default, it uses the ``P%yY%mM%dDT%hH%iM%sS`` format. +:class:`Symfony\\Component\\Serializer\\Normalizer\\FormErrorNormalizer` + This normalizer works with classes that implement + :class:`Symfony\\Component\\Form\\FormInterface`. + + It will get errors from the form and normalize them into an normalized array. + :class:`Symfony\\Component\\Serializer\\Normalizer\\ConstraintViolationListNormalizer` This normalizer converts objects that implement :class:`Symfony\\Component\\Validator\\ConstraintViolationListInterface` diff --git a/serializer.rst b/serializer.rst index b8c1e5ff18c..7645a1f228f 100644 --- a/serializer.rst +++ b/serializer.rst @@ -67,6 +67,9 @@ As well as the following normalizers: for :phpclass:`DateInterval` objects * :class:`Symfony\\Component\\Serializer\\Normalizer\\DataUriNormalizer` to transform :phpclass:`SplFileInfo` objects in `Data URIs`_ +* :class:`Symfony\\Component\\Serializer\\Normalizer\\FormErrorNormalizer` for + objects implementing the :class:`Symfony\\Component\\Form\\FormInterface` to + normalize form errors. * :class:`Symfony\\Component\\Serializer\\Normalizer\\JsonSerializableNormalizer` to deal with objects implementing the :phpclass:`JsonSerializable` interface * :class:`Symfony\\Component\\Serializer\\Normalizer\\ArrayDenormalizer` to diff --git a/serializer/normalizers.rst b/serializer/normalizers.rst index 5aef4568dc6..002cc02a433 100644 --- a/serializer/normalizers.rst +++ b/serializer/normalizers.rst @@ -36,6 +36,9 @@ Symfony includes the following normalizers but you can also transform :phpclass:`SplFileInfo` objects in `Data URIs`_ * :class:`Symfony\\Component\\Serializer\\Normalizer\\CustomNormalizer` to normalize PHP object using an object that implements +* :class:`Symfony\\Component\\Serializer\\Normalizer\\FormErrorNormalizer` for + objects implementing the :class:`Symfony\\Component\\Form\\FormInterface` to + normalize form errors. :class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizableInterface`; * :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer` to normalize PHP object using the getter and setter methods of the object;