File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -810,7 +810,13 @@ The ``JsonEncoder``
810810~~~~~~~~~~~~~~~~~~~
811811
812812The ``JsonEncoder `` encodes to and decodes from JSON strings, based on the PHP
813- :phpfunction: `json_encode ` and :phpfunction: `json_decode ` functions.
813+ :phpfunction: `json_encode ` and :phpfunction: `json_decode ` functions. It can be
814+ useful to modify how these functions operate in certain instances by providing
815+ options such as ``JSON_PRESERVE_ZERO_FRACTION ``. You can use the serialization
816+ context to pass in these options using the key ``json_encode_options `` or
817+ ``json_decode_options `` respectively::
818+
819+ $this->serializer->serialize($data, 'json', ['json_encode_options' => \JSON_PRESERVE_ZERO_FRACTION]);
814820
815821The ``CsvEncoder ``
816822~~~~~~~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments