Skip to content
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

Fix JSON printer handling of inf and nan #4087

Merged
merged 1 commit into from Apr 3, 2024

Conversation

jachris
Copy link
Contributor

@jachris jachris commented Apr 2, 2024

The JSON printer previously printed invalid JSON for inf and nan, which means that serve could sometimes emit invalid JSON, which is not handled well by platform/app. Instead, we now emit null.

- {"inf": inf.0, "nan": nan, "subnormal": 2.2250738585072e-310, "zero": -0.0}
+ {"inf": null, "nan": null, "subnormal": 2.2250738585072e-310, "zero": -0.0}

@jachris jachris added bug Incorrect behavior format Parser and printer labels Apr 2, 2024
Copy link
Member

@mavam mavam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to add a changelog entry for this bugfix.

@jachris jachris force-pushed the topic/fix-json-printer-inf-nan branch from 5a93824 to 48d387e Compare April 3, 2024 07:50
@jachris jachris enabled auto-merge April 3, 2024 07:50
@jachris jachris force-pushed the topic/fix-json-printer-inf-nan branch from 48d387e to be2797c Compare April 3, 2024 14:15
@jachris jachris merged commit 57b9096 into main Apr 3, 2024
51 checks passed
@jachris jachris deleted the topic/fix-json-printer-inf-nan branch April 3, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior format Parser and printer
Projects
None yet
2 participants