Remove brace initialization of json objects

Brace initialization of json objects, while quite interesting from an
academic sense, are very difficult for people to grok, and lead to
inconsistencies.  This patchset aims to remove a majority of them in
lieu of operator[].  Interestingly, this saves about 1% of the binary
size of bmcweb.

This also has an added benefit that as a design pattern, we're never
constructing a new object, then moving it into place, we're always
adding to the existing object, which in the future _could_ make things
like OEM schemas or properties easier, as there's no case where we're
completely replacing the response object.

Tested:
Ran redfish service validator.  No new failures.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Iae409b0a40ddd3ae6112cb2d52c6f6ab388595fe
diff --git a/redfish-core/lib/task.hpp b/redfish-core/lib/task.hpp
index 199bc84..0c2eee4 100644
--- a/redfish-core/lib/task.hpp
+++ b/redfish-core/lib/task.hpp
@@ -139,11 +139,13 @@
             res.result(boost::beast::http::status::accepted);
             std::string strIdx = std::to_string(index);
             std::string uri = "/redfish/v1/TaskService/Tasks/" + strIdx;
-            res.jsonValue = {{"@odata.id", uri},
-                             {"@odata.type", "#Task.v1_4_3.Task"},
-                             {"Id", strIdx},
-                             {"TaskState", state},
-                             {"TaskStatus", status}};
+
+            res.jsonValue["@odata.id"] = uri;
+            res.jsonValue["@odata.type"] = "#Task.v1_4_3.Task";
+            res.jsonValue["Id"] = strIdx;
+            res.jsonValue["TaskState"] = state;
+            res.jsonValue["TaskStatus"] = status;
+
             res.addHeader(boost::beast::http::field::location,
                           uri + "/Monitor");
             res.addHeader(boost::beast::http::field::retry_after,
@@ -416,14 +418,16 @@
                 if (ptr->payload)
                 {
                     const task::Payload& p = *(ptr->payload);
-                    asyncResp->res.jsonValue["Payload"] = {
-                        {"TargetUri", p.targetUri},
-                        {"HttpOperation", p.httpOperation},
-                        {"HttpHeaders", p.httpHeaders},
-                        {"JsonBody",
-                         p.jsonBody.dump(
-                             2, ' ', true,
-                             nlohmann::json::error_handler_t::replace)}};
+                    asyncResp->res.jsonValue["Payload"]["TargetUri"] =
+                        p.targetUri;
+                    asyncResp->res.jsonValue["Payload"]["HttpOperation"] =
+                        p.httpOperation;
+                    asyncResp->res.jsonValue["Payload"]["HttpHeaders"] =
+                        p.httpHeaders;
+                    asyncResp->res.jsonValue["Payload"]["JsonBody"] =
+                        p.jsonBody.dump(
+                            2, ' ', true,
+                            nlohmann::json::error_handler_t::replace);
                 }
                 asyncResp->res.jsonValue["PercentComplete"] =
                     ptr->percentComplete;
@@ -493,8 +497,8 @@
                 health->populate();
                 asyncResp->res.jsonValue["Status"]["State"] = "Enabled";
                 asyncResp->res.jsonValue["ServiceEnabled"] = true;
-                asyncResp->res.jsonValue["Tasks"] = {
-                    {"@odata.id", "/redfish/v1/TaskService/Tasks"}};
+                asyncResp->res.jsonValue["Tasks"]["@odata.id"] =
+                    "/redfish/v1/TaskService/Tasks";
             });
 }