I would recommend leaving the flag on - otherwise implicit conversion from raw to smart pointers might happen in the shadows, as better explained by Jules on this post:
The way around it is to change the line: result->setProperty (child.getType(), var (valueTreeToJsonObj (child)));
to result->setProperty (child.getType(), var ((valueTreeToJsonObj (child)).get()));