clockworklabs / SpacetimeDB

Multiplayer at the speed of light
https://spacetimedb.com
Other
4.41k stars 110 forks source link

U128 is JSON-serialized as a bare number #1850

Closed kazimuth closed 1 month ago

kazimuth commented 1 month ago

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

kazimuth commented 1 month ago

This is apparently the native behavior of serde_json. https://github.com/clockworklabs/SpacetimeDB/pull/1616 adds the serde_json arbitrary_precision feature to enable serde_json to correctly deserialize values like this to serde_json::Value.