4 ms·
A better format would specify the precision of integers so you can depend on it. Now you need to know the limitations of all implementations if you want to use
by pg314 10y ago
A better format would specify the precision of integers so you can depend on it. Now you need to know the limitations of all implementations if you want to use it as an interchange format. It doesn't even mention the issue in the spec, even going as far as saying, "A number is very much like a C or Java number"[1], which is misleading to say the least. Your API written in C might work with a Java client, but if someone writes a JavaScript client, it will break.
I'm sure there is a ton of code out there that doesn't take this precision issue into account. It seems like Twitter ran into that issue at some point, because in their APIs they have both id and id_str (see [2]).
[1] http://www.json.org/ http://www.json.org/
[2] https://dev.twitter.com/overview/api/twitter-ids-json-and-snowflake https://dev.twitter.com/overview/api/twitter-ids-json-and-sn...