4 ms·
How is that a JSON issue? It's inability to specify the type of a data element?
by EpicEng 10y ago
How is that a JSON issue? It's inability to specify the type of a data element?
- pg314 10y agoA 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...