Skip to content

Commit 3c9e289

Browse files
committed
Minor tweak
1 parent 6d11c55 commit 3c9e289

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

components/serializer.rst

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,10 @@ As for groups, attributes can be selected during both the serialization and dese
413413
Ignoring Attributes
414414
-------------------
415415

416-
All attributes are included by default when serializing objects. You have two alternatives to ignore some of those attributes.
416+
All attributes are included by default when serializing objects. There are two
417+
options to ignore some of those attributes.
417418

418-
* `Option 1: Using @Ignore annotation`_
419-
* `Option 2: Using the context`_
420-
421-
Option 1: Using ``@Ignore`` annotation
419+
Option 1: Using ``@Ignore`` Annotation
422420
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
423421

424422
.. configuration-block::
@@ -461,7 +459,7 @@ Option 1: Using ``@Ignore`` annotation
461459
</class>
462460
</serializer>
463461
464-
You are now able to ignore specific attributes during serialization::
462+
You can now ignore specific attributes during serialization::
465463

466464
use App\Model\MyClass;
467465
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
@@ -477,12 +475,12 @@ You are now able to ignore specific attributes during serialization::
477475
$data = $serializer->normalize($obj);
478476
// $data = ['foo' => 'foo'];
479477

480-
481-
Option 2: Using the context
478+
Option 2: Using the Context
482479
~~~~~~~~~~~~~~~~~~~~~~~~~~~
483480

484-
By providing an array via the ``AbstractNormalizer::IGNORED_ATTRIBUTES``
485-
key in the ``context`` parameter of the desired serializer method::
481+
Pass an array with the names of the attributes to ignore using the
482+
``AbstractNormalizer::IGNORED_ATTRIBUTES`` key in the ``context`` of the
483+
serializer method::
486484

487485
use Acme\Person;
488486
use Symfony\Component\Serializer\Encoder\JsonEncoder;
@@ -805,7 +803,7 @@ There are several types of normalizers available:
805803

806804
:class:`Symfony\\Component\\Serializer\\Normalizer\\ProblemNormalizer`
807805
Normalizes errors according to the API Problem spec `RFC 7807`_.
808-
806+
809807
.. _component-serializer-encoders:
810808

811809
Encoders

0 commit comments

Comments
 (0)