I use the following workflow to create a json file with the contents of an object:
rapidjson::Document document; rapidjson::StringBuffer s; rapidjson::Writer&