summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEd Tanous <ed@tanous.net>2024-03-07 04:39:13 +0300
committerEd Tanous <ed@tanous.net>2024-03-21 02:29:38 +0300
commit425e81c6ff4339b6dbebaad75e9a8393e5a7d09b (patch)
treec9881118ac09216ee4c3154960772839c7a75e52 /include
parent9e9b6049332c485123e1222ae9ee555d016c0066 (diff)
downloadbmcweb-425e81c6ff4339b6dbebaad75e9a8393e5a7d09b.tar.xz
Clean up management console rest to use readJson
Change-Id: Idc37e3e98296cf59aa6fab499a27d7ed899b71dd Signed-off-by: Ed Tanous <ed@tanous.net>
Diffstat (limited to 'include')
-rw-r--r--include/ibm/management_console_rest.hpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/ibm/management_console_rest.hpp b/include/ibm/management_console_rest.hpp
index 103017bf09..a2da64fd9a 100644
--- a/include/ibm/management_console_rest.hpp
+++ b/include/ibm/management_console_rest.hpp
@@ -403,7 +403,7 @@ inline void handleFileUrl(const crow::Request& req,
inline void
handleAcquireLockAPI(const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
- std::vector<nlohmann::json> body)
+ std::vector<nlohmann::json::object_t> body)
{
LockRequests lockRequestStructure;
for (auto& element : body)
@@ -412,11 +412,11 @@ inline void
uint64_t resourceId = 0;
SegmentFlags segInfo;
- std::vector<nlohmann::json> segmentFlags;
+ std::vector<nlohmann::json::object_t> segmentFlags;
- if (!redfish::json_util::readJson(element, asyncResp->res, "LockType",
- lockType, "ResourceID", resourceId,
- "SegmentFlags", segmentFlags))
+ if (!redfish::json_util::readJsonObject(
+ element, asyncResp->res, "LockType", lockType, "ResourceID",
+ resourceId, "SegmentFlags", segmentFlags))
{
BMCWEB_LOG_DEBUG("Not a Valid JSON");
asyncResp->res.result(boost::beast::http::status::bad_request);
@@ -432,9 +432,9 @@ inline void
std::string lockFlags;
uint32_t segmentLength = 0;
- if (!redfish::json_util::readJson(e, asyncResp->res, "LockFlag",
- lockFlags, "SegmentLength",
- segmentLength))
+ if (!redfish::json_util::readJsonObject(
+ e, asyncResp->res, "LockFlag", lockFlags, "SegmentLength",
+ segmentLength))
{
asyncResp->res.result(boost::beast::http::status::bad_request);
return;
@@ -744,7 +744,7 @@ inline void requestRoutes(App& app)
.methods(boost::beast::http::verb::post)(
[](const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp) {
- std::vector<nlohmann::json> body;
+ std::vector<nlohmann::json::object_t> body;
if (!redfish::json_util::readJsonAction(req, asyncResp->res, "Request",
body))
{