Make registries return an object_t
All the registry helper functions should return an object_t, given that
they're guaranteed to return an object. nlohmann::json as a type can
technically be string/int/bool/null/object/array, so it causes some
peculiarities in parsing.
Change-Id: If296477cb8d066d7f44ef0d12f17d94a5301e450
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/redfish-core/src/heartbeat_messages.cpp b/redfish-core/src/heartbeat_messages.cpp
index 2f9575e..28991dc 100644
--- a/redfish-core/src/heartbeat_messages.cpp
+++ b/redfish-core/src/heartbeat_messages.cpp
@@ -31,8 +31,9 @@
namespace messages
{
-static nlohmann::json getLog(redfish::registries::HeartbeatEvent::Index name,
- std::span<const std::string_view> args)
+static nlohmann::json::object_t getLog(
+ redfish::registries::HeartbeatEvent::Index name,
+ std::span<const std::string_view> args)
{
size_t index = static_cast<size_t>(name);
if (index >= redfish::registries::HeartbeatEvent::registry.size())
@@ -51,7 +52,7 @@
* See header file for more information
* @endinternal
*/
-nlohmann::json redfishServiceFunctional()
+nlohmann::json::object_t redfishServiceFunctional()
{
return getLog(
redfish::registries::HeartbeatEvent::Index::redfishServiceFunctional,