Add odata.type for ClientCertificate/Certificates
This Certificate URI does not give the odata.type.
```
curl -k -X GET https://${bmc}/redfish/v1/AccountService/MultiFactorAuth/ClientCertificate/Certificates
{
"Members": [],
"Members@odata.count": 0
}
```
As a result, Redfish Service Validator may fail if this URI is
triggered.
This adds the type like
```
curl -k -X GET https://${bmc}/redfish/v1/AccountService/MultiFactorAuth/ClientCertificate/Certificates
{
"@odata.id": "/redfish/v1/AccountService/MultiFactorAuth/ClientCertificate/Certificates",
"@odata.type": "#CertificateCollection.CertificateCollection"
"Members": [],
"Members@odata.count": 0
"Name": "Certificates Collection"
}%
```
Change-Id: I9c453c6c5ba093a6a3a0530e99d2bf8766a98ed3
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index e16751b..8b312b1 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -1308,6 +1308,13 @@
{
return;
}
+
+ nlohmann::json& json = asyncResp->res.jsonValue;
+ json["@odata.id"] =
+ "/redfish/v1/AccountService/MultiFactorAuth/ClientCertificate/Certificates";
+ json["@odata.type"] = "#CertificateCollection.CertificateCollection";
+ json["Name"] = "Certificates Collection";
+ json["Description"] = "Multi-factor Authentication Client Certificates";
getClientCertificates(asyncResp, "/Members"_json_pointer);
}