Fix PowerSubsystem/PowerSupplies causing validator to fail
In the following commit[1], the member of Members was removed by
mistake, causing the validator to fail. This commit fixes this
problem.
Redfish validator failing with the following:
ERROR - Members: Mandatory prop does not exist
1 failMandatoryExist errors in
/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies
1 failMandatoryExist errors in
/redfish/v1/Chassis/motherboard/PowerSubsystem/PowerSupplies
[1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/57668/26..29//COMMIT_MSG#b15
Tested: Validator passes
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I814e07d860422c5dce0fbb6267cb58dc07a74c31
diff --git a/redfish-core/lib/power_supply.hpp b/redfish-core/lib/power_supply.hpp
index 9fffa19..266bda2 100644
--- a/redfish-core/lib/power_supply.hpp
+++ b/redfish-core/lib/power_supply.hpp
@@ -44,6 +44,8 @@
"PowerSubsystem", "PowerSupplies");
asyncResp->res.jsonValue["Description"] =
"The collection of PowerSupply resource instances.";
+ asyncResp->res.jsonValue["Members"] = nlohmann::json::array();
+ asyncResp->res.jsonValue["Members@odata.count"] = 0;
std::string powerPath = *validChassisPath + "/powered_by";
dbus::utility::getAssociationEndPoints(