Skip to content

Commit d1add24

Browse files
committed
[Serializer] Add support for seld/jsonlint
1 parent d476a49 commit d1add24

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

components/serializer.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,20 @@ context to pass in these options using the key ``json_encode_options`` or
999999

10001000
$this->serializer->serialize($data, 'json', ['json_encode_options' => \JSON_PRESERVE_ZERO_FRACTION]);
10011001

1002+
These are the options available:
1003+
1004+
=============================== ===================================================== ================================
1005+
Option Description Default
1006+
=============================== ===================================================== ================================
1007+
``json_decode_associative`` If set to true returns the result as an array, ``false``
1008+
returns a nested ``stdClass`` hierarchy otherwise. ``false``
1009+
``json_decode_detailed_errors`` If set to true, exceptions thrown on parsing of JSON ``false``
1010+
are more specific. Requires `seld/jsonlint`_ package.
1011+
``json_encode_options`` `$flags`_ passed to `json_decode`_ function ``0``
1012+
``json_decode_options`` `$flags`_ passed to `json_encode`_ function ``\JSON_PRESERVE_ZERO_FRACTION``
1013+
``json_decode_recursion_depth`` Sets maximum recursion depth ``512``
1014+
=============================== ===================================================== ================================
1015+
10021016
The ``CsvEncoder``
10031017
~~~~~~~~~~~~~~~~~~
10041018

@@ -1828,3 +1842,7 @@ Learn more
18281842
.. _`RFC 4122`: https://tools.ietf.org/html/rfc4122
18291843
.. _`PHP reflection`: https://php.net/manual/en/book.reflection.php
18301844
.. _`data URI`: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
1845+
.. _seld/jsonlint: https://github.com/Seldaek/jsonlint
1846+
.. _json_decode: https://www.php.net/manual/en/function.json-decode.php
1847+
.. _json_encode: https://www.php.net/manual/en/function.json-encode.php
1848+
.. _$flags: https://www.php.net/manual/en/json.constants.php

0 commit comments

Comments
 (0)