Re: std.json / nested key/value access?

2019-11-15 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-11-15 17:23:38 +, Steven Schveighoffer said: On 11/15/19 12:05 PM, Robert M. Münch wrote: JSONValue j = parseJSON(json_string).object;  writeln(j); // works  writeln(j["a"]); // works  writeln(j["a"].object["b"]); // bombs

Re: std.json / nested key/value access?

2019-11-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/15/19 12:05 PM, Robert M. Münch wrote: JSONValue j = parseJSON(json_string).object;  writeln(j); // works  writeln(j["a"]); // works  writeln(j["a"].object["b"]); // bombs auto json_string = `{"a": {"b": 1}}`; Results with your

std.json / nested key/value access?

2019-11-15 Thread Robert M. Münch via Digitalmars-d-learn
I have: JSONValue j = parseJSON(json_string).object; writeln(j);// works writeln(j["a"]); // works writeln(j["a"].object["b"]); // bombs Runtime error: std.json.JSONException@std/json.d(276):