JSONValue.arrayNoRef

inout(JSONValue[]) arrayNoRef() @property inout pure @trusted

Value getter for JSONType.array. Unlike array, this retrieves the array by value and can be used in @safe code.

One possible caveat is that, if you append to the returned array, the new values aren't visible in the JSONValue:

JSONValue json;
json.array = [JSONValue("hello")];
json.arrayNoRef ~= JSONValue("world");
assert(json.array.length == 1);

Throws

JSONException for read access if type is not

JSONType.array.