query_param: Update OutOfRange error message for $top and $skip
According to "Table 8 - Query parameters" of Redfish spec, the value of
$top can be 0. And $skip can also be 0 to support getting all members,
though it is not specified in spec. This commit updates the error
message accordingly.
Tested:
Error message change only since 0 is already supported in bmcweb.
Change-Id: I5cc3fd7d283f8ee4dfca9325615545d1446e2133
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
diff --git a/redfish-core/include/utils/query_param.hpp b/redfish-core/include/utils/query_param.hpp
index fb3b5bd..889a684 100644
--- a/redfish-core/include/utils/query_param.hpp
+++ b/redfish-core/include/utils/query_param.hpp
@@ -230,7 +230,7 @@
{
messages::queryParameterOutOfRange(
res, value, "$top",
- "1-" + std::to_string(maxEntriesPerPage));
+ "0-" + std::to_string(maxEntriesPerPage));
return std::nullopt;
}
}
@@ -246,7 +246,7 @@
{
messages::queryParameterOutOfRange(
res, value, key,
- "1-" + std::to_string(std::numeric_limits<size_t>::max()));
+ "0-" + std::to_string(std::numeric_limits<size_t>::max()));
return std::nullopt;
}
}