Fix base registry validator failure
The latest version of the registries causes a validator failure:
"ERROR - Messages.UndeterminedFault.ParamTypes: Value of Collection
property is null but Collections cannot be null, only their entries"
This appears to be because of a base registry bug where
UndeterminedFault has "NumberOfArgs": 1, but then is missing the
ParamTypes key. This causes bmcweb to produce
ParamTypes: null
in the json, which is definitely incorrect.
This commit throws some duct tape over the problem for the moment, and
forces the key to at least be the correct type. This changes the
response to:
ParamTypes: []
While this is still incorrect, bmcweb now passes the service validator,
which I think is ok for the moment. I will follow up with a DMTF bug
against the base registry shortly, but because it will likely take them
several months to release a new revision, this temporary fix will be
required in the meantime.
Tested:
Ran service validator before and after this patch, and observed the
aformentioned behavior, and the validator now passes on the base
Registry schema.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I7d007a0614e833b0a254c78cad068d3eb5fe88e3
diff --git a/redfish-core/lib/message_registries.hpp b/redfish-core/lib/message_registries.hpp
index d0757b3..41713ce 100644
--- a/redfish-core/lib/message_registries.hpp
+++ b/redfish-core/lib/message_registries.hpp
@@ -213,6 +213,7 @@
if (message->second.numberOfArgs > 0)
{
nlohmann::json& messageParamArray = obj["ParamTypes"];
+ messageParamArray = nlohmann::json::array();
for (const char* str : message->second.paramTypes)
{
if (str == nullptr)