Format readjson
clang-format may potentially reformat the readJson calls if they may
have more keys or key names are longer. This makes formatting in a way
that's readable by forcing to break a line for each key using an
empty-comment (`//`) each line.
It also allows trivially alphabetizing the list such that new additions
are less likely to have merge conflicts.
Tested:
- Check whitespace only.
- Code compiles.
- Redfish Service Validator with the same results before this
Change-Id: I3824a8c4faa9fa7c820d5d2fab6b565404926e2c
Signed-off-by: Ed Tanous <etanous@nvidia.com>
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp
index d284361..36a3b15 100644
--- a/redfish-core/lib/power.hpp
+++ b/redfish-core/lib/power.hpp
@@ -88,8 +88,10 @@
auto& item = powerControlCollections[0];
std::optional<uint32_t> value;
- if (!json_util::readJsonObject(item, sensorsAsyncResp->asyncResp->res,
- "PowerLimit/LimitInWatts", value))
+ if (!json_util::readJsonObject( //
+ item, sensorsAsyncResp->asyncResp->res, //
+ "PowerLimit/LimitInWatts", value //
+ ))
{
return;
}
@@ -305,9 +307,11 @@
std::optional<std::vector<nlohmann::json::object_t>> voltageCollections;
std::optional<std::vector<nlohmann::json::object_t>> powerCtlCollections;
- if (!json_util::readJsonPatch(req, sensorAsyncResp->asyncResp->res,
- "PowerControl", powerCtlCollections,
- "Voltages", voltageCollections))
+ if (!json_util::readJsonPatch( //
+ req, sensorAsyncResp->asyncResp->res, //
+ "PowerControl", powerCtlCollections, //
+ "Voltages", voltageCollections //
+ ))
{
return;
}