Redfish: Adding bool support in readJson
Adding boolean support in json_utils.
Test:
Validated by sending redfish POST/PATCH
request with boolean value in data.
Change-Id: Iddc7daebb3507a468cbb2187806908f821bd6da7
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
diff --git a/redfish-core/include/utils/json_utils.hpp b/redfish-core/include/utils/json_utils.hpp
index aa45261..4c35b0c 100644
--- a/redfish-core/include/utils/json_utils.hpp
+++ b/redfish-core/include/utils/json_utils.hpp
@@ -152,7 +152,8 @@
value = static_cast<Type>(*jsonPtr);
}
- else if constexpr (std::is_unsigned_v<Type>)
+ else if constexpr ((std::is_unsigned_v<Type>)&&(
+ !std::is_same_v<bool, Type>))
{
uint64_t* jsonPtr = jsonValue.get_ptr<uint64_t*>();
if (!checkRange<Type>(jsonPtr, key, jsonValue, res))