xdg-app-builder manifests would be much nicer as YAML
Closed this issue · 5 comments
I think xdg-app-builder would be much better if manifests could be written as YAML. In YAML, you can have comments, and multiline strings. In JSON you can have neither, which makes it bad for writing build instructions.
This isn't very urgent because one can fairly easily write the manifest in YAML, then convert it to JSON. (python -c "import json, sys, yaml; data = yaml.load(sys.stdin); json.dump(data, sys,stdout)"
). The bug is mostly to see if you are in favour if the idea.
The C library libyaml is probably the best bet for doing this, but it doesn't have any kind of GObject wrapping. Probably not trivial to give it an interface that matches what you get from json-glib
Due to json-glib implementation details we do actually support /* */ style comments. Although doing so is not technically Jason.
I've mostly avoided the need for multilinear strings by using out of band files for eg larger scripts.
For whatever it's worth, I mostly wish now the places I'd used JSON (e.g. gnome-continuous, rpm-ostree treefiles) had been yaml.
One route to YAML support would be link against this fork of libyaml that allows converting a parsed libyaml document to a tree of JSON-GLib nodes, which would then let you use the GObject integration that JSON-GLib provides but use the libyaml parser.
That said, it seems unlikely that this branch would actually get merged, and it's not the cleanest solution to have ever existed .. to put it mildly.. https://bitbucket.org/samthursfield/libyaml/pull-requests/new?source=json-glib-integration&t=1
Closing this. Its far to late to change this now.
Note however, that json-glib does support single-line c-style comments