On 8/1/22 2:00 PM, hype_editor wrote:
I need to convert variable of type `JSONValue` to variable of type
`string[string]` (AssociativeArray).
```d
import std.json : JSONValue;
import std.stdio : writefln;
void main()
{
JSONValue data = parseJSON(`{ "name": "Hype Editor", "hobby":
"Progra
On 8/1/22 15:47, Steven Schveighoffer wrote:
You beat me to it. I used .object and .str:
import std;
void main()
{
JSONValue data = parseJSON(`{ "name": "Hype Editor", "hobby":
"Programming" }`);
writefln("%s", data);
// This already sees the data as an AA but the type is
JSONVa
On Monday, 1 August 2022 at 22:47:03 UTC, Steven Schveighoffer
wrote:
On 8/1/22 2:00 PM, hype_editor wrote:
[...]
```d
// option 1
string[string] aa_data;
foreach(string k, v; data) {
aa_data[k] = v.get!string;
}
// option 2
import std.algorithm : map;
import std.ar