I'm using nlohmann::json
and all I need to do is copy a JSON object and then alter some of the keys in it. Is it possible to alter keys in nlohmann::json
objects?
Essentially what I'm trying to do is the following:
json obj1 = {"key with space" : 10}
json obj2(obj1);
# .change_key not a real function
obj2.change_key("key with spaces", "key_with_spaces");
.change_key
is the part that I need some help on.