Skip to content

[Serializer] options to encode/decode with JSON #19376

Closed
@llaville

Description

@llaville

Hello,

I think that the documentation is wrong about json_encode_options and json_decode_options

We actually can read at https://github.com/symfony/symfony-docs/blob/7.1/components/serializer.rst?plain=1#L1008-L1009

``json_encode_options``          `$flags`_ passed to :phpfunction:`json_decode` function.                                                    ``0``
``json_decode_options``          `$flags`_ passed to :phpfunction:`json_encode` function.                                                    ``\JSON_PRESERVE_ZERO_FRACTION``

Should it be rather the opposite ?

``json_encode_options``          `$flags`_ passed to :phpfunction:`json_encode` function.                                                    ``0``
``json_decode_options``          `$flags`_ passed to :phpfunction:`json_decode` function.                                                    ``\JSON_PRESERVE_ZERO_FRACTION``

Metadata

Metadata

Assignees

No one assigned

    Labels

    SerializerhasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions