Chopin wrote:
Thanks! I tried using it:
auto document = parseJSON(content).array; // this works with std.json :)
Using json.d from the link:
auto j = JSONReader!string(content);
auto document = j.value.whole.array; // this doesn't.... "Error:
undefined identifier 'array'"
If you're sure that content is an array:
auto j = JSONReader!string(content);
auto jv = j.value.whole;
assert(jv.type == JSONType.array);
auto jsonArray = jv.as!(JSONValue[]);
alternatively you can replace last line with
alias JSONValue[] JSONArray;
auto jsonArray = jv.as!JSONArray;