News for hackers. Stuff that matters.
Re:Ask HN: Do you use JSON Schema? Help us shape its future ... by jjgreen on Tuesday January 31, 2023 @04:54AM (#34593283)
It is a scandal that JSON does not support the BigInt type.
Re:Ask HN: Do you use JSON Schema? Help us shape its future ... by throwawaymaths on Tuesday January 31, 2023 @03:11PM (#34601196)
It does. Just string encode it.
Re:Ask HN: Do you use JSON Schema? Help us shape its future ... by jjgreen on Tuesday January 31, 2023 @04:46PM (#34602707)

   1 == "1"; // true
   1n == "1"; // true
   1n == "1n"; // false
Re:Ask HN: Do you use JSON Schema? Help us shape its future ... by throwawaymaths on Tuesday January 31, 2023 @11:02PM (#34606190)
You have to describe what your encoding is in the "format" field of your JSONschema and implement the correct semantic meaning.
Re:Ask HN: Do you use JSON Schema? Help us shape its future ... by awwright on Tuesday January 31, 2023 @10:33PM (#34605994)
It 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.