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

U128 is JSON-serialized as a bare number #1850

Closed
kazimuth opened this issue Oct 14, 2024 · 1 comment
Closed

U128 is JSON-serialized as a bare number #1850

kazimuth opened this issue Oct 14, 2024 · 1 comment

Comments

@kazimuth
Copy link
Contributor

kazimuth commented Oct 14, 2024

Unlike U256, which is serialized as a hex string.
This may cause issues with some JSON implementations that deserialize numbers as floating point.

@kazimuth kazimuth changed the title U128 is serialized as bare number U128 is JSON-serialized as a bare number Oct 14, 2024
@kazimuth
Copy link
Contributor Author

This is apparently the native behavior of serde_json. #1616 adds the serde_json arbitrary_precision feature to enable serde_json to correctly deserialize values like this to serde_json::Value.

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

No branches or pull requests

1 participant