3 ms·
It is a scandal that JSON does not support the BigInt type.
by jjgreen 4y ago
It is a scandal that JSON does not support the BigInt type.
- throwawaymaths 4y agoIt does. Just string encode it.
- jjgreen 4y ago1 == "1"; // true 1n == "1"; // true 1n == "1n"; // false
- throwawaymaths 4y agoYou have to describe what your encoding is in the "format" field of your JSONschema and implement the correct semantic meaning.
- awwright 4y agoIt does. In fact, not only does JSON support big ints, but it supports arbitrary-precision base-10 decimal numbers. Whether your JSON parser will preserve the precision correctly is another story. For JavaScript/ECMAScript, you'll need to use a library.