I would like to have write_json
output a top level array, something to the effect of:
[{...},{...},{...},...,{...}]
But when I pass a list to write_json
, it converts to a json full of blank keys.
{"":{...},"":{...},"":{...},..."":{...}}
Using add_child
actually respects the array and gives me the closest thing of:
{"Some Key":[{...},{...},{...},...,{...}]}
But that's still not what I want.
Any idea how to make that array top level?
Boost does not have a JSON library (nor does it have an XML library). It has a Property Tree library (which happens to include a JSON compatible representation).
The limitations you run into are perfectly clearly documented right there: http://www.boost.org/doc/libs/1_62_0/doc/html/property_tree/parsers.html#property_tree.parsers.json_parser
It goes on to show an example of EXACTLY what you run into.