Merge: JSON serialization: write pretty JSON
authorJean Privat <jean@pryen.org>
Sat, 23 Apr 2016 08:31:31 +0000 (04:31 -0400)
committerJean Privat <jean@pryen.org>
Sat, 23 Apr 2016 08:31:31 +0000 (04:31 -0400)
commit0e5d23eedb7c5852a2ec24f4abc8dee6d0c7b755
treefcbd61269cf881e61f6d2f13c4c94e9b7e0459df
parenta39fa6ab6fc441a48f07c4941c9ed1eac3a91523
parent897ef9efee1a7f889f088fdfec9075cecd33c3d8
Merge: JSON serialization: write pretty JSON

Intro an option in `JsonSerializer` to write pretty indented JSON. By default, the generated JSON is somewhat minified, this could be improved if needed.

See the generated JSON in the tests below. I chose to leave the metadata and other special short objects non-indented as they are not intended for humans. The option `plain_json` is fully compatible with `pretty_json` (see alt4.res), I expect them to be used together often.

This was requested by @Morriar and it could allow us to deprecate the `json::static` writer API.

Pull-Request: #2035
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>