When trying to minify a deeply nested JSON file (~10k deep) using jq
I got a parse error:
$ jq -c . <input.json >minified.json
parse error: Exceeds depth limit for parsing at line 227263, column 355
How can I increase the depth limit? Is there a command line option? I couldn't find anything about this in the man page.
jq -c
to convert to compact form, rather than doing anything fancier, I'd think about switching to an alternate implementation; there's a native-Go alternative at github.com/itchyny/gojq f/e, orpython -mjson.tool --compact
may suffice. Could still potentially hit a max stack depth on either of those, but I'd start by testing. – Lexicostatistics