|
Post by AMI_Mani on Oct 26, 2023 17:53:10 GMT
Hi, NTPServers is defined in ManagerNetworkProtocol as below "NTPServers": { "description": "Indicates to which user-supplied NTP servers this manager is subscribed.", "items": { "type": [ "string", "null" ] }, "longDescription": "This property shall contain all the user-supplied NTP servers for which this manager is using to obtain time. NetworkSuppliedServers is used for NTP servers supplied by other network protocols such as DHCP.", "readonly": false, "type": "array", "versionAdded": "v1_2_0" }, User is allowed to patch array of values. These array can be considered as Primary Server, Secondary server values and implementation is not allow to remove Primary Server value in patch request and returning 400 bad request. For this scenario Protocol validator is throwing error as below "REQ_PATCH_ARRAY_ELEMENT_REMOVE: "Within a PATCH request, the service shall accept null to remove an element."" In specification also there is no clear details for handling array like above, I hope blocking null to remove Primary NTP server as per implementation. Do we need to check this issue in Protocol validator or it can be implementation specific? Thanks, Mani
|
|
|
Post by mraineri on Oct 26, 2023 18:09:39 GMT
The "PATCH on array properties" clause of the Redfish Specification is clear about this behavior: a user providing null indicates the removal of the entry. It also states that for fixed or variable length arrays the service will shift other entries up to not have null gaps, while for rigid arrays it will leave the entry blank.
The specification also states this about rigid arrays:
> Any array property that uses this style shall indicate the rigid style in the long description of its schema definition.
The property NTPServers is not defined as a rigid array, so the expectation is if a user provides the value '[ null, {}, "time.gov" ]', the service will remove the first entry, preserve the value of the second entry, change the third entry to "time.gov", and then shift the array to not have null gaps at the start of the array. However, it sounds like you are implementing this as a rigid array, which is not expected.
|
|