diff options
author | Ed Tanous <edtanous@google.com> | 2022-05-16 19:28:30 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-05-16 21:30:04 +0300 |
commit | b2c7e20813074bf498fb0030ee800d1424fcf460 (patch) | |
tree | 2ac9458735d8d7a19f896229e6740bbafe2b62c8 | |
parent | e7dbd530a5c5ba9ae29ee50fd7c1e61a128afc9b (diff) | |
download | bmcweb-b2c7e20813074bf498fb0030ee800d1424fcf460.tar.xz |
Fix regression in ComputerSystem
Despite the pseudo non-plural name "Links.Chassis", the Redfish schema
states that Chassis is an array of chassis, not a singular chassis.
While odd, we should obey the specification.
This resolves the regression introduced by 1476687de
Tested: Code compiles, code inspection looks correct.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I4d6d0554865e412137c44562d173a6efe3f88f4a
-rw-r--r-- | redfish-core/lib/systems.hpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp index e136aeaff3..58bab2ddbf 100644 --- a/redfish-core/lib/systems.hpp +++ b/redfish-core/lib/systems.hpp @@ -2965,8 +2965,11 @@ inline void requestRoutesSystems(App& app) getMainChassisId( asyncResp, [](const std::string& chassisId, const std::shared_ptr<bmcweb::AsyncResp>& aRsp) { - aRsp->res.jsonValue["Links"]["Chassis"]["@odata.id"] = - "/redfish/v1/Chassis/" + chassisId; + nlohmann::json::array_t chassisArray; + nlohmann::json& chassis = chassisArray.emplace_back(); + chassis["@odata.id"] = "/redfish/v1/Chassis/" + chassisId; + aRsp->res.jsonValue["Links"]["Chassis"] = + std::move(chassisArray); }); getLocationIndicatorActive(asyncResp); |