-
Notifications
You must be signed in to change notification settings - Fork 51
xdrjson: Rust: Render 64-bit integers as strings #181
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
Comments
Given that so many tools support 64-bit integers in JSON I'm thinking maybe we should follow a pattern I've heard folks using, where the 64-bit integer is encoded into two fields, in a number in a field by it's native name, and in a string in a field by its native name suffixed with For example: {
"my_field": 1,
"my_field_str": "1",
// ... The downside of this is that someone may still use the |
If 64-bit integers become rendered as strings, and 128-bit and 256-bit integers also become rendered as strings (stellar/rs-stellar-xdr#430), should XDR-JSON render 32-bit integers as strings for consistency? |
@leighmcculloch I would prefer using |
I too am in favor of a "native support when possible" approach though I don't feel strongly about this. As long as whatever we use |
Opened issue on serde_json about difficulty specifying 64-bit integers serialize when they are inside other types: |
What
Render 64-bit integers as strings in JSON.
Why
JS runtimes cannot correctly decode JSON numbers greater than 53-bits.
The text was updated successfully, but these errors were encountered: