|
Post by tophercantrell on Oct 30, 2018 13:13:50 GMT
I may be mistaken here (I am still a noob and learning), but Redfish arrays are fixed length, right? The client cannot patch back a shorter or longer list for the array. For true lists that grow/shrink I would use a collection, right?
If my implementation of EthernetInterface.StaticNameServers supports two entries, then back and forth I would always send two entries.
Most other arrays have two types: the "real" type and "null" to use for "empty slots".
If this were the case for EthernetInterface.StaticNameServers then we could use entries like ["1.2.3.4",null] and [null,"1.2.3.4"] and [null,null].
Since "null" is not an option, should we use an empty string like ["1.2.3.4",""] and ["","1.2.3.4"] and ["",""] ?
|
|
|
Post by mraineri on Jan 9, 2019 14:22:28 GMT
This looks like an oversight with how this property is defined. Thinking about the use case you have, I tend to agree that null would make more sense for an unused slot instead of an empty string. We'll discuss this further in the forum.
|
|
|
Post by jautor on Jan 10, 2019 23:13:26 GMT
I may be mistaken here (I am still a noob and learning), but Redfish arrays are fixed length, right? The client cannot patch back a shorter or longer list for the array. For true lists that grow/shrink I would use a collection, right? No, if the implementation (and the property) are read-write, a PATCH can be used to shrink or grow the array as follows: "MyProperty": [ "a", "b", "c", "d"] PATCH "MyProperty": [ "a", null, "c", "d" ] will remove "b" from the array ==> ["a", "c", "d"] PATCH "MyProperty": [ "a", "b", "c", "d", "pineapple" ] will add 'pineapple' to the array And for doing changes where you don't want to affect other items, you can use empty JSON objects instead of filling in the full contents: PATCH "MyProperty": [ "Elephant", {}, {}, {} ] will change 'a' to 'Elephant' and leave the other items as-is: ==> ["Elephant", "b", "c", "d" ] And I agree with mraineri that null should be allowed in the StaticNameServers array... Jeff
|
|