Skip to content

Commit

Permalink
Updated documentation &
Browse files Browse the repository at this point in the history
  • Loading branch information
slava-v authored and slava-v committed Oct 25, 2020
1 parent ac37611 commit 89bf4b2
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions doc/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,22 @@ a serialization context from your callable and use it.
``->setDeserializationContextFactory(function () { /* ... */ })``
to be used with methods ``deserialize()`` and ``fromArray()``.
Setting a default behaviour for skipping properties with empty values - `@SkipWhenEmpty` annotation
Setting a default behaviour for skipping properties with empty values - `SkipWhenEmpty`_ annotation
---------------------------------------------------------------------------------------------------
To avoid to specifying the annotation skipWhenEmpty for each property
it is possible to enable this behaviour in configuration by calling enableSkipWhenEmpty
To avoid to specifying the annotation ``@skipWhenEmpty`` for each property
it is possible to enable this behaviour in configuration by calling ``enableSkipWhenEmpty``

Example using with the SerializerBuilder::

.. code-block :: php
use JMS\Serializer\SerializationContext;

$serializer = JMS\Serializer\SerializerBuilder::create()
->setSerializationContextFactory(function () {

return SerializationContext::create()
->enableSkipWhenEmpty()
;
->enableSkipWhenEmpty();

})
->build()
;
->build();

.. _SkipWhenEmpty: reference/annotations.html#skipwhenempty

0 comments on commit 89bf4b2

Please sign in to comment.