[conspire] YAML, JSON, XML, oh my
Deirdre Saoirse Moen
deirdre at deirdre.net
Fri Jan 10 14:07:53 PST 2020
> On Jan 10, 2020, at 08:52, Josef Grosch <jgrosch at gmail.com> wrote:
>
> XML is mostly gone except it is used in Maven and Tomcat. XML is verbose but it's one advantage over json and yaml is that you can embed comments in the file. I prefer json over yaml for the same complaint I have with Python, the lack of real block delimiters. I really like the fact that their are json beautifiers which also catch mistakes in the json file.
>
> cat random-file.json | python -m json.tool
>
> Josef
Yes, but Tomcat is Fucking Java (aka Cobol 2.0), so I’d expect that. Maven likewise.
I agree with yo uthat a JSON linter and prettifier is a really valuable thing. I actually use the one built into TextMate quite a bit.
Which reminds me: I’d wanted a command-line grep-like thing, but for JSON that operated on selectors.
So in the previous example, let’s assume monsters was nested inside of something else.
$ jsongrep -monsters -name “Forest.*” -speed
So it’d print out matches for the “name” matches within “monsters” that matched the regex and then also print any fields after that were specified. (Otherwise…print the whole match? Dunno.)
Deirdre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://linuxmafia.com/pipermail/conspire/attachments/20200110/a7705493/attachment.html>
More information about the conspire
mailing list