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/event_service.hpp b/redfish-core/lib/event_service.hpp
index 60946b2..ca1e713 100644
--- a/redfish-core/lib/event_service.hpp
+++ b/redfish-core/lib/event_service.hpp
@@ -118,11 +118,12 @@
std::optional<bool> serviceEnabled;
std::optional<uint32_t> retryAttemps;
std::optional<uint32_t> retryInterval;
-
- if (!json_util::readJsonPatch(
- req, asyncResp->res, "ServiceEnabled", serviceEnabled,
- "DeliveryRetryAttempts", retryAttemps,
- "DeliveryRetryIntervalSeconds", retryInterval))
+ if (!json_util::readJsonPatch( //
+ req, asyncResp->res, //
+ "DeliveryRetryAttempts", retryAttemps, //
+ "DeliveryRetryIntervalSeconds", retryInterval, //
+ "ServiceEnabled", serviceEnabled //
+ ))
{
return;
}
@@ -302,23 +303,22 @@
std::optional<std::vector<nlohmann::json::object_t>> headers;
std::optional<std::vector<nlohmann::json::object_t>> mrdJsonArray;
- // clang-format off
- if (!json_util::readJsonPatch(
- req, asyncResp->res,
- "Context", context,
- "DeliveryRetryPolicy", retryPolicy,
- "Destination", destUrl,
- "EventFormatType", eventFormatType2,
- "HttpHeaders", headers,
- "MessageIds", msgIds,
- "MetricReportDefinitions", mrdJsonArray,
- "OriginResources", originResources,
- "Protocol", protocol,
- "RegistryPrefixes", regPrefixes,
- "ResourceTypes", resTypes,
- "SubscriptionType", subscriptionType,
- "VerifyCertificate", verifyCertificate
- ))
+ if (!json_util::readJsonPatch( //
+ req, asyncResp->res, //
+ "Context", context, //
+ "DeliveryRetryPolicy", retryPolicy, //
+ "Destination", destUrl, //
+ "EventFormatType", eventFormatType2, //
+ "HttpHeaders", headers, //
+ "MessageIds", msgIds, //
+ "MetricReportDefinitions", mrdJsonArray, //
+ "OriginResources", originResources, //
+ "Protocol", protocol, //
+ "RegistryPrefixes", regPrefixes, //
+ "ResourceTypes", resTypes, //
+ "SubscriptionType", subscriptionType, //
+ "VerifyCertificate", verifyCertificate //
+ ))
{
return;
}
@@ -755,11 +755,13 @@
std::optional<bool> verifyCertificate;
std::optional<std::vector<nlohmann::json::object_t>> headers;
- if (!json_util::readJsonPatch(
- req, asyncResp->res, "Context", context,
- "VerifyCertificate", verifyCertificate,
- "DeliveryRetryPolicy", retryPolicy, "HttpHeaders",
- headers))
+ if (!json_util::readJsonPatch( //
+ req, asyncResp->res, //
+ "Context", context, //
+ "DeliveryRetryPolicy", retryPolicy, //
+ "HttpHeaders", headers, //
+ "VerifyCertificate", verifyCertificate //
+ ))
{
return;
}