Parse number types from the base registry
Rather than maintaining a list of arguments that are numbers (which is
error prone), update the script to just trust that the few parameters
labeled in Redfish as numbers should in fact show up in the API as
numbers.
Functionally this changes the APIs for only a few error messages, only
one of which (StringValueTooShort) is used and that usage was added
recently.
Tested: SRV passes.
Change-Id: I580523ecc0263688738bcb7f7925913e40e2a113
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/redfish-core/include/error_messages.hpp b/redfish-core/include/error_messages.hpp
index b9fd429..98b3988 100644
--- a/redfish-core/include/error_messages.hpp
+++ b/redfish-core/include/error_messages.hpp
@@ -219,9 +219,9 @@
* @param[in] arg1 Parameter of message that will replace %1 in its body.
*
* @returns Message InvalidJSON formatted to JSON */
-nlohmann::json::object_t invalidJSON(std::string_view arg1);
+nlohmann::json::object_t invalidJSON(uint64_t arg1);
-void invalidJSON(crow::Response& res, std::string_view arg1);
+void invalidJSON(crow::Response& res, uint64_t arg1);
/**
* @brief Formats EmptyJSON message into JSON
@@ -412,10 +412,10 @@
*
* @returns Message ArraySizeTooShort formatted to JSON */
nlohmann::json::object_t arraySizeTooShort(std::string_view arg1,
- std::string_view arg2);
+ uint64_t arg2);
void arraySizeTooShort(crow::Response& res, std::string_view arg1,
- std::string_view arg2);
+ uint64_t arg2);
/**
* @brief Formats QueryParameterValueTypeError message into JSON
@@ -960,10 +960,10 @@
*
* @returns Message StringValueTooShort formatted to JSON */
nlohmann::json::object_t stringValueTooShort(std::string_view arg1,
- std::string_view arg2);
+ uint64_t arg2);
void stringValueTooShort(crow::Response& res, std::string_view arg1,
- std::string_view arg2);
+ uint64_t arg2);
/**
* @brief Formats SessionTerminated message into JSON
diff --git a/redfish-core/include/resource_messages.hpp b/redfish-core/include/resource_messages.hpp
index 98290ee..be642e9 100644
--- a/redfish-core/include/resource_messages.hpp
+++ b/redfish-core/include/resource_messages.hpp
@@ -38,16 +38,16 @@
std::string_view arg2);
nlohmann::json::object_t resourceErrorThresholdExceeded(std::string_view arg1,
- std::string_view arg2);
+ uint64_t arg2);
nlohmann::json::object_t resourceErrorThresholdCleared(std::string_view arg1,
- std::string_view arg2);
+ uint64_t arg2);
-nlohmann::json::object_t resourceWarningThresholdExceeded(
- std::string_view arg1, std::string_view arg2);
+nlohmann::json::object_t resourceWarningThresholdExceeded(std::string_view arg1,
+ uint64_t arg2);
nlohmann::json::object_t resourceWarningThresholdCleared(std::string_view arg1,
- std::string_view arg2);
+ uint64_t arg2);
nlohmann::json::object_t resourceStatusChangedOK(std::string_view arg1,
std::string_view arg2);