JSONParser.getAssoc

Get an associative array from the JSON.

struct JSONParser
T[wstring]
getAssoc
(
T
)
()

Return Value

Type: T[wstring]

The requested associative array.

Throws

JSONException on type mismatch or syntax error.

Examples

auto json = JSONParser(q{
    {
        "hello": 123,
        "foo": -123,
        "test": 42.123
    }
});

auto assoc = json.getAssoc!float;

assert(assoc["hello"] == 123);
assert(assoc["foo"] == -123);
assert(assoc["test"] == 42.123f);

Meta