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

JSON encoding for 64 bit numbers. #11

Open
samuelvarley opened this issue Feb 16, 2017 · 0 comments
Open

JSON encoding for 64 bit numbers. #11

samuelvarley opened this issue Feb 16, 2017 · 0 comments

Comments

@samuelvarley
Copy link

Google's spec for converting between proto3 and JSON[1] specifies that 64 bit integers should be encoded as JSON strings instead of JSON numbers. I think it would be a good idea to follow that because:

  • Javascript cannot represent all 64 bit integers in its native numerical type.
  • It would allow the full range of uint64 to be used.

However, the spec also states that 64 bit integers encoded as JSON numbers should be accepted (i.e. be permissive). Following that may not be a good idea because it could appear to work when testing with small integers but fail with larger integers that Jansson cannot handle.

Would you be interested in a pull request for this? Do you have any other insight I should be aware of?

[1] https://developers.google.com/protocol-buffers/docs/proto3#json

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

No branches or pull requests

1 participant