summaryrefslogtreecommitdiff
path: root/redfish-core/include
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-06-27 23:43:46 +0300
committerEd Tanous <ed@tanous.net>2023-06-13 20:48:37 +0300
commit14fbced62e8e6e7e2d9c948f287fbde30721489a (patch)
treeed3f2ab2d73a1db6055ed67055dcf875d1c71610 /redfish-core/include
parentf818b04dad9601ca620a4afabadc83faa1c29735 (diff)
downloadbmcweb-14fbced62e8e6e7e2d9c948f287fbde30721489a.tar.xz
Make propertyValueIncorrect typesafe
Similar to the previous patches, make propertyValueIncorrect accept a nlohmann::json object as input. This removes the need for the dump() call, which oddly enough, in our one usage, was actually incorrect, and could cause bmcweb to throw an exception in parsing in theory. Tested: Only used in one error condition. Code compiles. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ie35d61101c2db88b16d42d71e66bceef540e8429
Diffstat (limited to 'redfish-core/include')
-rw-r--r--redfish-core/include/error_messages.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/redfish-core/include/error_messages.hpp b/redfish-core/include/error_messages.hpp
index a396603afe..c49ac3319e 100644
--- a/redfish-core/include/error_messages.hpp
+++ b/redfish-core/include/error_messages.hpp
@@ -490,10 +490,10 @@ 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(std::string_view arg1,
+nlohmann::json propertyValueIncorrect(const nlohmann::json& arg1,
std::string_view arg2);
-void propertyValueIncorrect(crow::Response& res, std::string_view arg1,
+void propertyValueIncorrect(crow::Response& res, const nlohmann::json& arg1,
std::string_view arg2);
/**