{ "name": "John", "age": 30 }
rapidjson::Value myCity; myCity.SetString("New York", allocator); myObject.AddMember("city", myCity, allocator);
{ "name": "John", "age": 30, "city": "New York" }
{ "name": "John", "age": 30, "address": { "street": "123 Main St", "city": "New York", "state": "NY" } }
rapidjson::Value myZip(10001); myObject["address"].AddMember("zip", myZip, allocator);
{ "name": "John", "age": 30, "address": { "street": "123 Main St", "city": "New York", "state": "NY", "zip": 10001 } }The Value AddMember function is part of the RapidJSON package library.