Simplify Redfish error message property interface
The error message code used a json_pointer object which must
begin with a '/' character and had to be sent as an extra
parameter. This change simplifies the interface by using a
string so there doesn't have to be a '/'. This allowed the
same property argument passed for the message to be used
for the property field path.
Tested: Sent an error with a property and verified that it is
correctly displayed.
Change-Id: I0571e2eee627cedf29d751588a4f1bceee66f084
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index c9555a1..20825d9 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -851,15 +851,14 @@
nlohmann::json::const_iterator caIt = rawPECICmd.find("ClientAddress");
if (caIt == rawPECICmd.end())
{
- messages::propertyMissing(asyncResp->res, "ClientAddress",
- "/ClientAddress");
+ messages::propertyMissing(asyncResp->res, "ClientAddress");
return;
}
const uint64_t *ca = caIt->get_ptr<const uint64_t *>();
if (ca == nullptr)
{
messages::propertyValueTypeError(asyncResp->res, caIt->dump(),
- "ClientAddress", "/ClientAddress");
+ "ClientAddress");
return;
}
// Get the Read Length from the request
@@ -867,15 +866,14 @@
nlohmann::json::const_iterator rlIt = rawPECICmd.find("ReadLength");
if (rlIt == rawPECICmd.end())
{
- messages::propertyMissing(asyncResp->res, "ReadLength",
- "/ReadLength");
+ messages::propertyMissing(asyncResp->res, "ReadLength");
return;
}
const uint64_t *rl = rlIt->get_ptr<const uint64_t *>();
if (rl == nullptr)
{
messages::propertyValueTypeError(asyncResp->res, rlIt->dump(),
- "ReadLength", "/ReadLength");
+ "ReadLength");
return;
}
// Get the PECI Command from the request
@@ -883,8 +881,7 @@
nlohmann::json::const_iterator pcIt = rawPECICmd.find("PECICommand");
if (pcIt == rawPECICmd.end())
{
- messages::propertyMissing(asyncResp->res, "PECICommand",
- "/PECICommand");
+ messages::propertyMissing(asyncResp->res, "PECICommand");
return;
}
std::vector<uint8_t> peciCommand;
@@ -895,8 +892,7 @@
{
messages::propertyValueTypeError(
asyncResp->res, pc.dump(),
- "PECICommand/" + std::to_string(peciCommand.size()),
- "/PECICommand");
+ "PECICommand/" + std::to_string(peciCommand.size()));
return;
}
peciCommand.push_back(static_cast<uint8_t>(*val));