diff options
Diffstat (limited to 'redfish-core/lib')
-rw-r--r-- | redfish-core/lib/account_service.hpp | 4 | ||||
-rw-r--r-- | redfish-core/lib/ethernet.hpp | 34 | ||||
-rw-r--r-- | redfish-core/lib/event_service.hpp | 4 | ||||
-rw-r--r-- | redfish-core/lib/hypervisor_system.hpp | 7 | ||||
-rw-r--r-- | redfish-core/lib/managers.hpp | 45 | ||||
-rw-r--r-- | redfish-core/lib/task.hpp | 4 |
6 files changed, 75 insertions, 23 deletions
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp index 3b6062ab21..2703008923 100644 --- a/redfish-core/lib/account_service.hpp +++ b/redfish-core/lib/account_service.hpp @@ -239,7 +239,9 @@ inline void handleRoleMapPatch( { BMCWEB_LOG_ERROR << "Can't delete the object"; messages::propertyValueTypeError( - asyncResp->res, thisJson.dump(), + asyncResp->res, + thisJson.dump(2, ' ', true, + nlohmann::json::error_handler_t::replace), "RemoteRoleMapping/" + std::to_string(index)); return; } diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp index 159eda2433..4dfef0fcfa 100644 --- a/redfish-core/lib/ethernet.hpp +++ b/redfish-core/lib/ethernet.hpp @@ -1403,8 +1403,11 @@ class EthernetInterface : public Node { if ((!input.is_array()) || input.empty()) { - messages::propertyValueTypeError(asyncResp->res, input.dump(), - "IPv4StaticAddresses"); + messages::propertyValueTypeError( + asyncResp->res, + input.dump(2, ' ', true, + nlohmann::json::error_handler_t::replace), + "IPv4StaticAddresses"); return; } @@ -1432,7 +1435,10 @@ class EthernetInterface : public Node "Gateway", gateway)) { messages::propertyValueFormatError( - asyncResp->res, thisJson.dump(), pathString); + asyncResp->res, + thisJson.dump(2, ' ', true, + nlohmann::json::error_handler_t::replace), + pathString); return; } @@ -1552,7 +1558,10 @@ class EthernetInterface : public Node return; } messages::propertyValueFormatError( - asyncResp->res, thisJson.dump(), pathString); + asyncResp->res, + thisJson.dump(2, ' ', true, + nlohmann::json::error_handler_t::replace), + pathString); return; } @@ -1598,8 +1607,11 @@ class EthernetInterface : public Node { if (!input.is_array() || input.empty()) { - messages::propertyValueTypeError(asyncResp->res, input.dump(), - "IPv6StaticAddresses"); + messages::propertyValueTypeError( + asyncResp->res, + input.dump(2, ' ', true, + nlohmann::json::error_handler_t::replace), + "IPv6StaticAddresses"); return; } size_t entryIdx = 1; @@ -1620,7 +1632,10 @@ class EthernetInterface : public Node prefixLength)) { messages::propertyValueFormatError( - asyncResp->res, thisJson.dump(), pathString); + asyncResp->res, + thisJson.dump(2, ' ', true, + nlohmann::json::error_handler_t::replace), + pathString); return; } @@ -1687,7 +1702,10 @@ class EthernetInterface : public Node return; } messages::propertyValueFormatError( - asyncResp->res, thisJson.dump(), pathString); + asyncResp->res, + thisJson.dump(2, ' ', true, + nlohmann::json::error_handler_t::replace), + pathString); return; } diff --git a/redfish-core/lib/event_service.hpp b/redfish-core/lib/event_service.hpp index f7b76d1b22..be6f04df2f 100644 --- a/redfish-core/lib/event_service.hpp +++ b/redfish-core/lib/event_service.hpp @@ -434,7 +434,9 @@ class EventDestinationCollection : public Node else { messages::propertyValueFormatError( - asyncResp->res, mrdObj.dump(), + asyncResp->res, + mrdObj.dump(2, ' ', true, + nlohmann::json::error_handler_t::replace), "MetricReportDefinitions"); return; } diff --git a/redfish-core/lib/hypervisor_system.hpp b/redfish-core/lib/hypervisor_system.hpp index 290bac7188..10b16f9656 100644 --- a/redfish-core/lib/hypervisor_system.hpp +++ b/redfish-core/lib/hypervisor_system.hpp @@ -553,8 +553,11 @@ class HypervisorInterface : public Node address, "SubnetMask", subnetMask, "Gateway", gateway)) { - messages::propertyValueFormatError(asyncResp->res, - thisJson.dump(), pathString); + messages::propertyValueFormatError( + asyncResp->res, + thisJson.dump(2, ' ', true, + nlohmann::json::error_handler_t::replace), + pathString); return; } diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp index 8953d7a46b..ea0589e862 100644 --- a/redfish-core/lib/managers.hpp +++ b/redfish-core/lib/managers.hpp @@ -901,7 +901,10 @@ inline CreatePIDRet createPidInterface( "PositiveHysteresis", doubles["PositiveHysteresis"], "NegativeHysteresis", doubles["NegativeHysteresis"])) { - BMCWEB_LOG_ERROR << "Illegal Property " << it.value().dump(); + BMCWEB_LOG_ERROR + << "Illegal Property " + << it.value().dump(2, ' ', true, + nlohmann::json::error_handler_t::replace); return CreatePIDRet::fail; } if (zones) @@ -1007,7 +1010,10 @@ inline CreatePIDRet createPidInterface( failSafePercent, "MinThermalOutput", minThermalOutput)) { - BMCWEB_LOG_ERROR << "Illegal Property " << it.value().dump(); + BMCWEB_LOG_ERROR + << "Illegal Property " + << it.value().dump(2, ' ', true, + nlohmann::json::error_handler_t::replace); return CreatePIDRet::fail; } @@ -1018,8 +1024,11 @@ inline CreatePIDRet createPidInterface( if (!redfish::json_util::readJson(*chassisContainer, response->res, "@odata.id", chassisId)) { - BMCWEB_LOG_ERROR << "Illegal Property " - << chassisContainer->dump(); + BMCWEB_LOG_ERROR + << "Illegal Property " + << chassisContainer->dump( + 2, ' ', true, + nlohmann::json::error_handler_t::replace); return CreatePIDRet::fail; } @@ -1056,7 +1065,10 @@ inline CreatePIDRet createPidInterface( "NegativeHysteresis", negativeHysteresis, "Direction", direction)) { - BMCWEB_LOG_ERROR << "Illegal Property " << it.value().dump(); + BMCWEB_LOG_ERROR + << "Illegal Property " + << it.value().dump(2, ' ', true, + nlohmann::json::error_handler_t::replace); return CreatePIDRet::fail; } @@ -1089,8 +1101,11 @@ inline CreatePIDRet createPidInterface( if (!redfish::json_util::readJson(step, response->res, "Target", target, "Output", out)) { - BMCWEB_LOG_ERROR << "Illegal Property " - << it.value().dump(); + BMCWEB_LOG_ERROR + << "Illegal Property " + << it.value().dump( + 2, ' ', true, + nlohmann::json::error_handler_t::replace); return CreatePIDRet::fail; } readings.emplace_back(target); @@ -1331,7 +1346,10 @@ struct SetPIDValues : std::enable_shared_from_this<SetPIDValues> "FanControllers", fanControllers, "FanZones", fanZones, "StepwiseControllers", stepwiseControllers, "Profile", profile)) { - BMCWEB_LOG_ERROR << "Illegal Property " << data.dump(); + BMCWEB_LOG_ERROR + << "Illegal Property " + << data.dump(2, ' ', true, + nlohmann::json::error_handler_t::replace); return; } configuration.emplace_back("PidControllers", std::move(pidControllers)); @@ -1996,7 +2014,10 @@ class Manager : public Node std::optional<nlohmann::json> openbmc; if (!redfish::json_util::readJson(*oem, res, "OpenBmc", openbmc)) { - BMCWEB_LOG_ERROR << "Illegal Property " << oem->dump(); + BMCWEB_LOG_ERROR + << "Illegal Property " + << oem->dump(2, ' ', true, + nlohmann::json::error_handler_t::replace); return; } if (openbmc) @@ -2004,7 +2025,11 @@ class Manager : public Node std::optional<nlohmann::json> fan; if (!redfish::json_util::readJson(*openbmc, res, "Fan", fan)) { - BMCWEB_LOG_ERROR << "Illegal Property " << openbmc->dump(); + BMCWEB_LOG_ERROR + << "Illegal Property " + << openbmc->dump( + 2, ' ', true, + nlohmann::json::error_handler_t::replace); return; } if (fan) diff --git a/redfish-core/lib/task.hpp b/redfish-core/lib/task.hpp index b6ca010ba4..dbc6278897 100644 --- a/redfish-core/lib/task.hpp +++ b/redfish-core/lib/task.hpp @@ -446,7 +446,9 @@ class Task : public Node {"TargetUri", p.targetUri}, {"HttpOperation", p.httpOperation}, {"HttpHeaders", p.httpHeaders}, - {"JsonBody", p.jsonBody.dump()}}; + {"JsonBody", + p.jsonBody.dump(2, ' ', true, + nlohmann::json::error_handler_t::replace)}}; } asyncResp->res.jsonValue["PercentComplete"] = ptr->percentComplete; } |