Skip to content

[HttpFoundation] Update DEFAULT_ENCODING_OPTIONS constant in JsonResponse following serializer updates #51409

Closed
@JorgeHRJ

Description

@JorgeHRJ

Description

In this PR #45554 (related to this issue #47183) was added the flag JSON_PRESERVE_ZERO_FRACTION as default in the JsonEncode default context. This is great, but in my opinion the DEFAULT_ENCODING_OPTIONS constant in class JsonResponse should be following this update and have the JSON_PRESERVE_ZERO_FRACTION flag in it.

At the moment the DEFAULT_ENCODING_OPTIONS value is 15 (which equals to JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT). I suggest update it to 1039 (which equals to JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_PRESERVE_ZERO_FRACTION.

Is this change worth it? Do you think it would be OK if I make a PR for this?

Kind regards

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions