summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Patel <Abhishek.Patel@ibm.com>2021-05-25 17:53:54 +0300
committerGunnar Mills <gmills@us.ibm.com>2021-05-28 19:40:44 +0300
commit5af690f5a027159e2fd92bbe78d5e1cf98146bf6 (patch)
tree41e6f02f257bc49b433b2ed2731e8e4aab0a45e9
parentb623d9c1b6605978eb6158619bb43c79a9f543fd (diff)
downloadbmcweb-5af690f5a027159e2fd92bbe78d5e1cf98146bf6.tar.xz
Adjust parameter name of FirmwareInventoryId
redfish URL "/redfish/v1/UpdateService/FirmwareInventory/ {SoftwareInventoryId}" had parameter called "Members@odata.count". This parameter name is not appropriate because it retrieves data, count of Related Item, from "RelatedItem" parameter, so its name has to be "RelatedItem@odata.count". Implement: Updated name of JSON parameter, also updated code variable name. Tested: Validator passes - Keep primary data and other parameter deleted from JSON data Old JSON data: { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/ {SoftwareInventoryId}, "@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory", "Description": "BMC image", "Members@odata.count": 1, "Name": "Software Inventory", "RelatedItem": [{ "@odata.id": "/redfish/v1/Managers/bmc" }], } new JSON data: { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/ {SoftwareInventoryId}, "@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory", "Description": "BMC image", "RelatedItem@odata.count": 1, "Name": "Software Inventory", "RelatedItem": [{ "@odata.id": "/redfish/v1/Managers/bmc" }], } Signed-off-by: Abhishek Patel <Abhishek.Patel@ibm.com> Change-Id: I12c123fc78872890efe2949d2a3a55f882cdd09b
-rw-r--r--redfish-core/lib/update_service.hpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index ca1234f3ec..9f6c6f9abd 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -786,16 +786,18 @@ class SoftwareInventory : public Node
{
if (purpose == fw_util::bmcPurpose)
{
- nlohmann::json& members = aResp->res.jsonValue["RelatedItem"];
- members.push_back({{"@odata.id", "/redfish/v1/Managers/bmc"}});
- aResp->res.jsonValue["Members@odata.count"] = members.size();
+ nlohmann::json& relatedItem = aResp->res.jsonValue["RelatedItem"];
+ relatedItem.push_back({{"@odata.id", "/redfish/v1/Managers/bmc"}});
+ aResp->res.jsonValue["RelatedItem@odata.count"] =
+ relatedItem.size();
}
else if (purpose == fw_util::biosPurpose)
{
- nlohmann::json& members = aResp->res.jsonValue["RelatedItem"];
- members.push_back(
+ nlohmann::json& relatedItem = aResp->res.jsonValue["RelatedItem"];
+ relatedItem.push_back(
{{"@odata.id", "/redfish/v1/Systems/system/Bios"}});
- aResp->res.jsonValue["Members@odata.count"] = members.size();
+ aResp->res.jsonValue["RelatedItem@odata.count"] =
+ relatedItem.size();
}
else
{