summaryrefslogtreecommitdiff
path: root/redfish-core/lib/task.hpp
diff options
context:
space:
mode:
authorArun Thomas Baby <arunx.thomas.baby.baby.mathew@intel.com>2023-05-02 13:22:23 +0300
committerEd Tanous <ed@tanous.net>2023-05-26 01:13:14 +0300
commit5db7dfd6278258fd069ae29881920e365a533547 (patch)
tree1983db4d498dec59efe09dbcdd656783c61d1e2b /redfish-core/lib/task.hpp
parent1d869608fb671a2c5e80563c9fa8c630aa728346 (diff)
downloadbmcweb-5db7dfd6278258fd069ae29881920e365a533547.tar.xz
Set HidePayload on Task when payload is null
The task payload object can be null in certain cases. As per the schema for Task, there is a standard property Hidepayload which can be set to true at this case. Setting this property as true in the response body when Payload is nil. Tested: Created a task without creating the task payload object and able to see Hidepayload as true in response body. Change-Id: I370d1eb9b5b96adb56cff2216b467357b0b34b42 Signed-off-by: Arun Thomas Baby <arunx.thomas.baby.baby.mathew@intel.com> Signed-off-by: Ed Tanous <edtanous@google.com>
Diffstat (limited to 'redfish-core/lib/task.hpp')
-rw-r--r--redfish-core/lib/task.hpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/redfish-core/lib/task.hpp b/redfish-core/lib/task.hpp
index e0058f52a7..78817ffdf7 100644
--- a/redfish-core/lib/task.hpp
+++ b/redfish-core/lib/task.hpp
@@ -417,6 +417,9 @@ inline void requestRoutesTask(App& app)
asyncResp->res.jsonValue["TaskMonitor"] =
"/redfish/v1/TaskService/Tasks/" + strParam + "/Monitor";
}
+
+ asyncResp->res.jsonValue["HidePayload"] = !ptr->payload;
+
if (ptr->payload)
{
const task::Payload& p = *(ptr->payload);