Emacs supports bignums, but presumably libjansson does not, and (and json-parse-buffer
is handing off to that C library to do the heavy lifting). There seems to be an upstream issue for that:
https://github.com/akheron/jansson/issues/69
The documentation for the current implementation is:
https://jansson.readthedocs.io/en/latest/conformance.html#numbers
From those docs, you'reyou are limited to either restricted to long
or long long
integers, depending on the compiler which built the library. A long will be a minimum of 32-bits, and a long long will be a minimum of 64-bits.
I would expect that you're dealing with the latter, and my impression is that a long long
tends to be no more than 64-bits, so that's (probably) a maximum of 18446744073709551615 unsigned, or 9223372036854775807 signed (and looking at your data, it's not a coincidence that your example failure is 1 higher than that number).
The older elisp-only (json-read)
is happy reading that file, FYI.
(require 'json)
(url-handler-mode 1)
(json-read-file "https://raw.githubusercontent.com/exercism/problem-specifications/f771129746264394c20d3c59ba5053acb9de5f86/exercises/grains/canonical-data.json")
That even works in Emacs 26 (i.e. without bignum support), although in that case numbers larger than most-positive-fixnum
are converted to floats.