You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 _str.
For example:
{"my_field": 1,"my_field_str": "1",// ...
The downside of this is that someone may still use the my_field in JS and unknowingly be interpreting the JSON data as a Number with lost precision.
leighmcculloch
changed the title
Rust: Render 64-bit integers as strings in JSON
Rust: Render 64-bit and larger integers as strings in JSON
Mar 21, 2024
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: