|
Post by philip on Sept 9, 2018 10:11:13 GMT
Hi All,
Since there are voltage sensors in a Power resource.
If there's only one sensor in the Voltages array, could it be any kind of unique string instead of a number sequence?
Could it be:
"Voltages": [ { "@odata.id": "xxxxxxxxxxx#/Voltages/3", "MemberId": "3".
or
"Voltages": [ { "@odata.id": "xxxxxxxxxxx#/Voltages/3V", "MemberId": "3V".
instead of
"Voltages": [ { "@odata.id": "xxxxxxxxxxx#/Voltages/0", "MemberId": "0".
There is an example in the Redfish Spec. as follow:
If a property in a response is a reference to another property within a resource, the "URI Fragment Identifier Representation" format as specified in RFC6901 shall be used. If the property is defined as a reference property within the schema, the fragment shall reference a valid resource identifier. For example, the following fragment identifies a property at index 0 of the Fans array within the resource /redfish/v1/Chassis/MultiBladeEncl/Thermal:
{ "@odata.id": "/redfish/v1/Chassis/MultiBladeEncl/Thermal#/Fans/0" }
IMO this does not imply that it should be started with 0, but the others have different opinion with me, is there any documentation about this? I think I am right but this does confuse some others.
Many thanks.
|
|
|
Post by mraineri on Sept 10, 2018 12:42:54 GMT
Since the Redfish specification makes normative references to RFC6901, the JSON fragment encoding must follow the rules in that RFC. With regards to the array evaluation portion of RFC6901, it does state that the token must be a zero-based index into the array: "characters comprised of digits (see ABNF below; note that leading zeros are not allowed) that represent an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index identified by the token".
So, using something like "#/Voltages/3V" is illegal, and also using "#/Voltages/3" as the first element in the array is also illegal.
|
|