Skip to content

[Serializer] enable JSON_PRESERVE_ZERO_FRACTION by default #47202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2022

Conversation

dbu
Copy link
Contributor

@dbu dbu commented Aug 5, 2022

this makes json output float values that happen to be full numbers with a .0, so 4.0 or 0.0 instead of 4 resp 0. that in turn helps when consuming the json in a type-safe language.

Q A
Branch? 6.2
Bug fix? no
New feature? no
Deprecations? no
Tickets As discussed in #47183
License MIT
Doc PR -

In #47183, @nicolas-grekas said that we should enable the preserve zero fraction flag by default in the serializer.

I am a bit unsure if we should consider this a BC break, as it does change the output of JSON data. Should it be considered a bugfix against 6.1, a feature against 6.2 or a BC break that has to wait until 7.0?

this makes json output float values that happen to be full numbers with a `.0`, so `4.0` or `0.0` instead of `4` resp `0`. that in turn helps when consuming the json in a type-safe language.
@dbu dbu requested a review from dunglas as a code owner August 5, 2022 13:02
@carsonbot carsonbot added this to the 6.2 milestone Aug 5, 2022
@carsonbot carsonbot changed the title enable JSON_PRESERVE_ZERO_FRACTION by default [Serializer] enable JSON_PRESERVE_ZERO_FRACTION by default Aug 7, 2022
@fabpot
Copy link
Member

fabpot commented Aug 7, 2022

Thank you @dbu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants