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/certificate_service.hpp b/redfish-core/lib/certificate_service.hpp
index 7ae194c..f16b169 100644
--- a/redfish-core/lib/certificate_service.hpp
+++ b/redfish-core/lib/certificate_service.hpp
@@ -66,9 +66,11 @@
std::string certificate;
std::optional<std::string> certificateType = "PEM";
- if (!json_util::readJsonPatch(req, asyncResp->res, "CertificateString",
- certificate, "CertificateType",
- certificateType))
+ if (!json_util::readJsonPatch( //
+ req, asyncResp->res, //
+ "CertificateString", certificate, //
+ "CertificateType", certificateType //
+ ))
{
BMCWEB_LOG_ERROR("Required parameters are missing");
messages::internalError(asyncResp->res);
@@ -497,9 +499,12 @@
std::string certURI;
std::optional<std::string> certificateType = "PEM";
- if (!json_util::readJsonAction(req, asyncResp->res, "CertificateString",
- certificate, "CertificateUri/@odata.id",
- certURI, "CertificateType", certificateType))
+ if (!json_util::readJsonAction( //
+ req, asyncResp->res, //
+ "CertificateString", certificate, //
+ "CertificateType", certificateType, //
+ "CertificateUri/@odata.id", certURI //
+ ))
{
BMCWEB_LOG_ERROR("Required parameters are missing");
return;
@@ -670,18 +675,28 @@
std::vector<std::string>();
std::optional<std::string> optSurname = "";
std::optional<std::string> optUnstructuredName = "";
- if (!json_util::readJsonAction(
- req, asyncResp->res, "City", city, "CommonName", commonName,
- "ContactPerson", optContactPerson, "Country", country,
- "Organization", organization, "OrganizationalUnit",
- organizationalUnit, "State", state,
- "CertificateCollection/@odata.id", certURI, "AlternativeNames",
- optAlternativeNames, "ChallengePassword", optChallengePassword,
- "Email", optEmail, "GivenName", optGivenName, "Initials",
- optInitials, "KeyBitLength", optKeyBitLength, "KeyCurveId",
- optKeyCurveId, "KeyPairAlgorithm", optKeyPairAlgorithm, "KeyUsage",
- optKeyUsage, "Surname", optSurname, "UnstructuredName",
- optUnstructuredName))
+ if (!json_util::readJsonAction( //
+ req, asyncResp->res, //
+ "AlternativeNames", optAlternativeNames, //
+ "CertificateCollection/@odata.id", certURI, //
+ "ChallengePassword", optChallengePassword, //
+ "City", city, //
+ "CommonName", commonName, //
+ "ContactPerson", optContactPerson, //
+ "Country", country, //
+ "Email", optEmail, //
+ "GivenName", optGivenName, //
+ "Initials", optInitials, //
+ "KeyBitLength", optKeyBitLength, //
+ "KeyCurveId", optKeyCurveId, //
+ "KeyPairAlgorithm", optKeyPairAlgorithm, //
+ "KeyUsage", optKeyUsage, //
+ "Organization", organization, //
+ "OrganizationalUnit", organizationalUnit, //
+ "State", state, //
+ "Surname", optSurname, //
+ "UnstructuredName", optUnstructuredName //
+ ))
{
return;
}