summaryrefslogtreecommitdiff
path: root/redfish-core
diff options
context:
space:
mode:
authorGinu George <ginugeorge@ami.com>2024-01-17 13:21:00 +0300
committerginugeorge <ginugeorge@ami.com>2024-01-17 15:07:55 +0300
commit367b3dce0567c223f53ce1a4cc10d34241111774 (patch)
tree6d150ad005368b326aa6bf10c236d46405c8b021 /redfish-core
parentf347756661ff81ff859ec15c16a0348ef5165bed (diff)
downloadbmcweb-367b3dce0567c223f53ce1a4cc10d34241111774.tar.xz
Pass correct Argument Types to propertyValueIncorrect Error Message
Changed the code to pass the parameters according to their types. Tested: Code Compiles properly and tested. Change-Id: Ie0e13d39cd892afda36dfabec871f0fe8d8498e4 Signed-off-by: Ginu George <ginugeorge@ami.com>
Diffstat (limited to 'redfish-core')
-rw-r--r--redfish-core/include/error_messages.hpp8
-rw-r--r--redfish-core/lib/metric_report_definition.hpp2
-rw-r--r--redfish-core/src/error_messages.cpp12
3 files changed, 11 insertions, 11 deletions
diff --git a/redfish-core/include/error_messages.hpp b/redfish-core/include/error_messages.hpp
index 09ac36eb2c..7adae19c87 100644
--- a/redfish-core/include/error_messages.hpp
+++ b/redfish-core/include/error_messages.hpp
@@ -491,11 +491,11 @@ void propertyValueExternalConflict(crow::Response& res, std::string_view arg1,
* @param[in] arg2 Parameter of message that will replace %2 in its body.
*
* @returns Message PropertyValueIncorrect formatted to JSON */
-nlohmann::json propertyValueIncorrect(const nlohmann::json& arg1,
- std::string_view arg2);
+nlohmann::json propertyValueIncorrect(std::string_view arg1,
+ const nlohmann::json& arg2);
-void propertyValueIncorrect(crow::Response& res, const nlohmann::json& arg1,
- std::string_view arg2);
+void propertyValueIncorrect(crow::Response& res, std::string_view arg1,
+ const nlohmann::json& arg2);
/**
* @brief Formats ResourceCreationConflict message into JSON
diff --git a/redfish-core/lib/metric_report_definition.hpp b/redfish-core/lib/metric_report_definition.hpp
index 6ad9f117d2..43a1849c28 100644
--- a/redfish-core/lib/metric_report_definition.hpp
+++ b/redfish-core/lib/metric_report_definition.hpp
@@ -737,7 +737,7 @@ class AddReport
metricProperties.emplace_back(uri);
}
messages::propertyValueIncorrect(
- asyncResp->res, metricProperties, "MetricProperties");
+ asyncResp->res, "MetricProperties", metricProperties);
return;
}
if (ec)
diff --git a/redfish-core/src/error_messages.cpp b/redfish-core/src/error_messages.cpp
index 7bbd877409..3c628b6579 100644
--- a/redfish-core/src/error_messages.cpp
+++ b/redfish-core/src/error_messages.cpp
@@ -860,17 +860,17 @@ void propertyValueExternalConflict(crow::Response& res, std::string_view arg1,
* See header file for more information
* @endinternal
*/
-nlohmann::json propertyValueIncorrect(const nlohmann::json& arg1,
- std::string_view arg2)
+nlohmann::json propertyValueIncorrect(std::string_view arg1,
+ const nlohmann::json& arg2)
{
- std::string arg1Str = arg1.dump(2, ' ', true,
+ std::string arg2Str = arg2.dump(2, ' ', true,
nlohmann::json::error_handler_t::replace);
return getLog(redfish::registries::base::Index::propertyValueIncorrect,
- std::to_array<std::string_view>({arg1Str, arg2}));
+ std::to_array<std::string_view>({arg1, arg2Str}));
}
-void propertyValueIncorrect(crow::Response& res, const nlohmann::json& arg1,
- std::string_view arg2)
+void propertyValueIncorrect(crow::Response& res, std::string_view arg1,
+ const nlohmann::json& arg2)
{
res.result(boost::beast::http::status::bad_request);
addMessageToErrorJson(res.jsonValue, propertyValueIncorrect(arg1, arg2));