bmcweb: Redfish away from json cache

In the original incarnation of bmcweb, route registration was done
automatically.  This has proved to be a terrible idea, wraught with
corner cases and issues.

The route registration is currently the only user of the
redfish::Node::json element.  Unfortunately, as written, this structure
consumes a lot of memory that's duplicated and not very useful.  From a
performance perspective, there is almost no difference between
rebuilding the structure for each GET request, and having the "cache"
that needs to be copied into the response and modified before it can be
useful.

In the programming tradeoffs for bmc, lower memory usage is more important
than latency, especially at these levels.

Change-Id: I785e8352123e5e886acf05cd59cb23648f93839d
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp
index cec62d5..0f2b92b 100644
--- a/redfish-core/lib/chassis.hpp
+++ b/redfish-core/lib/chassis.hpp
@@ -45,12 +45,6 @@
   public:
     ChassisCollection(CrowApp &app) : Node(app, "/redfish/v1/Chassis/")
     {
-        Node::json["@odata.type"] = "#ChassisCollection.ChassisCollection";
-        Node::json["@odata.id"] = "/redfish/v1/Chassis";
-        Node::json["@odata.context"] =
-            "/redfish/v1/$metadata#ChassisCollection.ChassisCollection";
-        Node::json["Name"] = "Chassis Collection";
-
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
             {boost::beast::http::verb::head, {{"Login"}}},
@@ -73,7 +67,12 @@
             "xyz.openbmc_project.Inventory.Item.PowerSupply",
             "xyz.openbmc_project.Inventory.Item.System",
         };
-        res.jsonValue = Node::json;
+        res.jsonValue["@odata.type"] = "#ChassisCollection.ChassisCollection";
+        res.jsonValue["@odata.id"] = "/redfish/v1/Chassis";
+        res.jsonValue["@odata.context"] =
+            "/redfish/v1/$metadata#ChassisCollection.ChassisCollection";
+        res.jsonValue["Name"] = "Chassis Collection";
+
         auto asyncResp = std::make_shared<AsyncResp>(res);
         crow::connections::systemBus->async_method_call(
             [asyncResp](const boost::system::error_code ec,
@@ -118,13 +117,6 @@
     Chassis(CrowApp &app) :
         Node(app, "/redfish/v1/Chassis/<str>/", std::string())
     {
-        Node::json["@odata.type"] = "#Chassis.v1_4_0.Chassis";
-        Node::json["@odata.id"] = "/redfish/v1/Chassis";
-        Node::json["@odata.context"] = "/redfish/v1/$metadata#Chassis.Chassis";
-        Node::json["Name"] = "Chassis Collection";
-        Node::json["ChassisType"] = "RackMount";
-        Node::json["PowerState"] = "On";
-
         entityPrivileges = {
             {boost::beast::http::verb::get, {{"Login"}}},
             {boost::beast::http::verb::head, {{"Login"}}},
@@ -150,7 +142,14 @@
             return;
         }
 
-        res.jsonValue = Node::json;
+        res.jsonValue["@odata.type"] = "#Chassis.v1_4_0.Chassis";
+        res.jsonValue["@odata.id"] = "/redfish/v1/Chassis";
+        res.jsonValue["@odata.context"] =
+            "/redfish/v1/$metadata#Chassis.Chassis";
+        res.jsonValue["Name"] = "Chassis Collection";
+        res.jsonValue["ChassisType"] = "RackMount";
+        res.jsonValue["PowerState"] = "On";
+
         const std::string &chassisId = params[0];
         auto asyncResp = std::make_shared<AsyncResp>(res);
         crow::connections::systemBus->async_method_call(