jaq
jaq copied to clipboard
Support YAML
The main difference between serde_json and serde_yaml seems to be that in YAML, map keys can be any value, whereas in JSON, map keys can be only strings.
We could lift the restriction on the key type to allow for YAML support quite quickly; however, the main blocker seems to be colored output of YAML values. This would then require a crate like colored_yaml --- which does not exist for now.
@01mf02 There is syntect which provides syntax highlighting for YAML as well. It's a pretty heavyweight dependency though, so not sure if this is what you are looking for.
@martinohmann: Thanks for the suggestion, but I suppose that this solution would be too slow, because it would require outputting YAML first as text, then parsing it with syntect, and only then outputting it.
I think it would be beneficial to add support for YAML even without colors at first. If you want, you could just hide support for YAML before some runtime experimental flag (--experimental-yaml
or something like it), so people would adjust their expectations accordingly.