I came across a project today that was blocked on getting YAML support for Serde, so I figured I would announce my YAML library here in case anyone else is blocked.
https://github.com/dtolnay/serde-yaml
[dependencies]
serde = "^0.7"
serde_yaml = "^0.2"
The API is largely identical to serde_json. It can serialize and deserialize by using yaml-rust for emitting and parsing YAML.
I have updated the Serde readme to refer to this.
6 Likes
Very nice! Maybe @erickt can move it into the serde organization if it's further along than the one currently in there.
It is decidedly further along and totally usable for both serializing and deserializing, since all of the heavy lifting is done by yaml-rust. The limitations are the ones listed in the yaml-rust readme: only partial support for the alias feature of YAML, and a few examples from the spec fail to parse (although the widely used libyaml also fails to parse the same ones, so probably not an issue for most people).
Erick suggested moving the whole thing into yaml-rust which I am considering.