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

Handle Infinity/NaN without invalid JSON #642

Closed
donaldatball opened this Issue Nov 8, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@donaldatball
Collaborator

donaldatball commented Nov 8, 2017

JSON explicitly disallows Infinity and NaN. Ruby and Python both have "allow_nan" flags that allow their JSON parsers to handle those values as "barewords" in the JSON string, but they cause problems elsewhere (specifically, Javascript rejects strings with those barewords). Instead of relying on the invalid JSON, we should convert those values into an object, similar to the way that non-printable strings/blocks are handled.

Note that I have no plans to actually set the allow_nan flag to false, so the bareword syntax will continue to work. It just won't be required.

@donaldatball donaldatball self-assigned this Nov 8, 2017

@donaldatball donaldatball added the feature label Nov 8, 2017

donaldatball added a commit that referenced this issue Nov 8, 2017

donaldatball added a commit that referenced this issue Nov 8, 2017

Merge pull request #643 from BallAerospace/json_inf_and_nan
re #642 Update json_rpc library to handle Infinity, -Infinity and NaN…
@donaldatball

This comment has been minimized.

Show comment
Hide comment
@donaldatball

donaldatball Nov 8, 2017

Collaborator

Closed with 28b70d7.

Collaborator

donaldatball commented Nov 8, 2017

Closed with 28b70d7.

@ryanmelt ryanmelt added this to the v4.1.0 milestone Nov 20, 2017

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