Function JSONValue.objectNoRef

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

inout inout(JSONValue[string]) objectNoRef() pure @property @trusted;

A caveat is that, if the returned value is null, modifications will not be visible:

JSONValue kson;
json.object!= null;
json.objectNoRef[

Throws

JSONException for read access if type is not JSONType.object.