Is there an option for it to read the contents from a pipe? that's by far my biggest use for the jq app.
FracturedJson
91–100 of 173 posts
Re: FracturedJson
#92Earlier quoted context omitted.
I just built a C++ formatter that does this (owned by my employee, unfortunately). There's really only two formatting objects: tab-aligned tables, and single line rows. Both objects also support a right-floating column/tab aligned "//" comment. Both objects desugar to a sequence of segments (lines). The result is that you can freely mix expression/assignment blocks & statements. Things like switch-case blocks & macro…
You built it, but your employee owns it? That sounds highly unusual.
Re: FracturedJson
#93Earlier quoted context omitted.
We stopped having this problem over ten years ago when spec 1.1 was implemented. Why are people still harking on about it?
Because there's a metric ton of software out there that was built once upon a time and then that bit was never updated. I've seen this issue out in the wild across more industries than I can count.
Re: FracturedJson
#94Is there an option for it to read the contents from a pipe? that's by far my biggest use for the jq app.
You can (usually) specify the input file name as “-“ (single hyphen) to read from stdin
I somewhat regularly use this on Linux. I think it also works on OS X
Re: FracturedJson
#95I made a silly groovy script called "mommyjson" that doesn't try to preserve JSON formatting but just focuses on giving you the parentage (thus the name) including array indexes, object names, etc., all on the same line, so that when you find something, you know exactly where it is semantically. Not gonna claim that everybody should use it or that it cures insomnia cancer & hangnails, but feel free to borrow it: http…
[0] - https://github.com/tomnomnom/gron [1] - https://github.com/ckampfe/jstream
Re: FracturedJson
#96Earlier quoted context omitted.
This is a reference to YAML parsing the two letter ISO country code for Norway: country: no As equivalent to a boolean falsy value: country: false It is a relatively common source of problems. One solution is to escape the value: country: “no” More context: https://www.bram.us/2022/01/11/yaml-the-norway-problem/
We stopped having this problem over ten years ago when spec 1.1 was implemented. Why are people still harking on about it?
E.g. kubernetes wrote about solving this only five months ago[1] and by moving from yaml to kyaml, a yaml subset.
[1]: https://kubernetes.io/blog/2025/07/28/kubernetes-v1-34-sneak...
Re: FracturedJson
#97Earlier quoted context omitted.
The Norway issue is a bit blown out of proportion seeing as the country should really be a string `"no"` rather than the `no` value
Yeah, but it's a fun slogan. My real peeve is constantly getting the spaces wrong and no tooling to compensete for its warts. If there were linters and test frameworks and unit tests etc for yaml, I'd just sigh and move on. But current situation is, for instance in ADO Yaml: "So it's time to cut a release and time is short - we have a surprise for you! This will make some condition go true which triggers something no…
Available and kept up-to-date. I found for Python, PHP:
https://github.com/j13k/yaml-lint
https://github.com/adrienverge/yamllint
Also .net:
https://github.com/aaubry/YamlDotNet
And NPM/js:
Re: FracturedJson
#98I made a silly groovy script called "mommyjson" that doesn't try to preserve JSON formatting but just focuses on giving you the parentage (thus the name) including array indexes, object names, etc., all on the same line, so that when you find something, you know exactly where it is semantically. Not gonna claim that everybody should use it or that it cures insomnia cancer & hangnails, but feel free to borrow it: http…
Re: FracturedJson
#99It looks like there are two maintained implementations of this at the moment - one in C# https://github.com/j-brooke/FracturedJson/wiki/.NET-Library and another in TypeScript/JavaScript https://github.com/j-brooke/FracturedJsonJs . They each have their own test suite. There's an older pure Python version but it's no longer maintained - the author of that recently replaced it with a Python library wrapping the C# code…
Re: FracturedJson
#100Earlier quoted context omitted.
You can (usually) specify the input file name as “-“ (single hyphen) to read from stdin
Or you can use `/dev/stdin`, which has the upside of not needing tool support. I somewhat regularly use this on Linux. I think it also works on OS X