service root: add ProtocolFeaturesSupported
This commits adds a dummy ProtocolFeaturesSupported object in the
service root. It indicates that none of the Query Parameter is
supported. Future commits will add supports for OnlyMemberQuery,
ExpandQuery, and so on.
Tested:
1. unit test
2. passed QEMU Redfish (which contains Redfish Validator) test
This commit is split from these changes:
https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/38952
https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/47474
Credits to maxiaochao@inspur.com, ed@tanous.net, and
zhanghch05@inspur.com.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I81ff856514528f63a462558a8f18fefe4369edae
diff --git a/redfish-core/lib/service_root.hpp b/redfish-core/lib/service_root.hpp
index 2a1803d..e2f32bb 100644
--- a/redfish-core/lib/service_root.hpp
+++ b/redfish-core/lib/service_root.hpp
@@ -16,6 +16,9 @@
#pragma once
#include <app.hpp>
+#include <async_resp.hpp>
+#include <http_request.hpp>
+#include <nlohmann/json.hpp>
#include <persistent_data.hpp>
#include <registries/privilege_registry.hpp>
#include <utils/systemd_utils.hpp>
@@ -64,6 +67,19 @@
asyncResp->res.jsonValue["TelemetryService"] = {
{"@odata.id", "/redfish/v1/TelemetryService"}};
asyncResp->res.jsonValue["Cables"] = {{"@odata.id", "/redfish/v1/Cables"}};
+
+ nlohmann::json& protocolFeatures =
+ asyncResp->res.jsonValue["ProtocolFeaturesSupported"];
+ protocolFeatures["ExcerptQuery"] = false;
+ protocolFeatures["ExpandQuery"]["ExpandAll"] = false;
+ protocolFeatures["ExpandQuery"]["Levels"] = false;
+ protocolFeatures["ExpandQuery"]["Links"] = false;
+ protocolFeatures["ExpandQuery"]["NoLinks"] = false;
+ protocolFeatures["FilterQuery"] = false;
+ protocolFeatures["OnlyMemberQuery"] = false;
+ protocolFeatures["SelectQuery"] = false;
+ protocolFeatures["DeepOperations"]["DeepPOST"] = false;
+ protocolFeatures["DeepOperations"]["DeepPATCH"] = false;
}
inline void requestRoutesServiceRoot(App& app)