summaryrefslogtreecommitdiff
path: root/redfish-core/lib/message_registries.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2021-06-11 19:34:52 +0300
committerEd Tanous <ed@tanous.net>2021-06-11 23:17:22 +0300
commit938f25685f4b93d632fe5169cf5e258164538114 (patch)
treeff9399d7912a2255857757b2ed5bfe5373c3d33e /redfish-core/lib/message_registries.hpp
parent9552547ce8a48583a7f33fbbdc6748ff02d7661b (diff)
downloadbmcweb-938f25685f4b93d632fe5169cf5e258164538114.tar.xz
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
Diffstat (limited to 'redfish-core/lib/message_registries.hpp')
-rw-r--r--redfish-core/lib/message_registries.hpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/redfish-core/lib/message_registries.hpp b/redfish-core/lib/message_registries.hpp
index d0757b364f..41713cefa1 100644
--- a/redfish-core/lib/message_registries.hpp
+++ b/redfish-core/lib/message_registries.hpp
@@ -213,6 +213,7 @@ inline void requestRoutesMessageRegistry(App& app)
if (message->second.numberOfArgs > 0)
{
nlohmann::json& messageParamArray = obj["ParamTypes"];
+ messageParamArray = nlohmann::json::array();
for (const char* str : message->second.paramTypes)
{
if (str == nullptr)