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 #18007: std/json now serializes nan,inf,-inf as strings instead of invalid json #18026

Merged
merged 7 commits into from
May 16, 2021

Conversation

timotheecour
Copy link
Member

@timotheecour timotheecour commented May 16, 2021

fix #18007
closes #18020

i could add a -d:nimLegacyJsonNaNInf if needed, but doesn't seem like it's needed in this case because the json that was previously generated was invalid

the serialization/deserialization is now rountrip safe and uses valid json

note

testRoundtripVal are from #18008 but since that PR wasn't merged yet and I needed those test procs, I've added those here

@timotheecour timotheecour marked this pull request as draft May 16, 2021 00:32
@timotheecour timotheecour changed the title fix #18007: std/json now serializes nan,inf,-inf as raw strings instead of invalid json fix #18007: std/json now serializes nan,inf,-inf as strings instead of invalid json May 16, 2021
@timotheecour timotheecour marked this pull request as ready for review May 16, 2021 02:25
@timotheecour timotheecour added the Ready For Review (please take another look): ready for next review round label May 16, 2021
@timotheecour timotheecour requested a review from ringabout May 16, 2021 08:28
changelog.md Outdated Show resolved Hide resolved
@Araq Araq merged commit d83b25d into nim-lang:devel May 16, 2021
@timotheecour timotheecour deleted the pr_fix_18007_json_nan_inf branch May 17, 2021 02:12
PMunch pushed a commit to PMunch/Nim that referenced this pull request Mar 28, 2022
…nstead of invalid json (nim-lang#18026)

* fix nim-lang#18007: std/json now serializes nan,inf,-inf as raw strings instead of invalid json

* fix roundtrip

* fix tests

* fix changelog

* simplify

* add runnableExamples

* fix typo [skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review (please take another look): ready for next review round
Projects
None yet
Development

Successfully merging this pull request may close these issues.

json.% generates invalid json for NaN, Inf
3 participants