Network : Fix the Service Validator Failure
On a DHCP Enabled System, the StaticNameServer property
is not aligned to the redfish schema rules and the validator
reports the below error:
StaticNameServers: Value of Collection property is null but
Collections cannot be null, only their entries.
Testedby: Redfish Validator
*** /redfish/v1/JsonSchemas/EthernetInterface
Type (#JsonSchemaFile.v1_0_2.JsonSchemaFile), GET SUCCESS (time: 1.134773)
PASS
Note:
- Previously missed this failure, as i verified the validator on
Statically configured setup
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I6119e8d5783571ac75084301b49df1f44a558c8b
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 17b953b..09074fd 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -1546,7 +1546,7 @@
}
else
{
- json_response["StaticNameServers"] = {};
+ json_response["StaticNameServers"] = nlohmann::json::array();
}
nlohmann::json &ipv4_array = json_response["IPv4Addresses"];