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/scripts/parse_registries.py b/scripts/parse_registries.py
index d60e523..03e44cb 100755
--- a/scripts/parse_registries.py
+++ b/scripts/parse_registries.py
@@ -334,7 +334,7 @@
args.append(f"{typename} arg{arg_index}")
function_name = entry_id[0].lower() + entry_id[1:]
arg = ", ".join(args)
- out += f"nlohmann::json {function_name}({arg})"
+ out += f"nlohmann::json::object_t {function_name}({arg})"
if is_header:
out += ";\n\n"
@@ -557,7 +557,7 @@
)
out.write(
"""
-static nlohmann::json getLog(redfish::registries::{struct_name}::Index name,
+static nlohmann::json::object_t getLog(redfish::registries::{struct_name}::Index name,
std::span<const std::string_view> args)
{{
size_t index = static_cast<size_t>(name);