|
Post by AMI_archerwen on May 9, 2022 4:02:04 GMT
About there is a property under the TelemetryService called "SupportedCollectionFunctions". This property looks like no order, but could we still follow below rule(this noted in spec) to implement this property? And if some other properties like this example, could we all implement by follow this rule?
|
|
|
Post by jautor on May 9, 2022 19:18:04 GMT
Yes, while the underlying function has no "order" to those values, it is still a JSON array and the PATCH handling rules are the same regardless.
Jeff
|
|
|
Post by AMI_archerwen on May 26, 2022 9:27:21 GMT
Hi, there is a rule defined in spec. A PATCH request with fewer elements than in the current array shall remove the remaining elements of the array.
And I have a example, here is the current value for "SupportedCollectionFunctions". "SupportedCollectionFunctions": [ "Minimum", "Average", "Summation", "Maximum" ]
Ex: So If we PATCH ["Minimum"], it shows like below after GET the resource? "SupportedCollectionFunctions": [ "Minimum", null, null, null ]
or we can just shows?
"SupportedCollectionFunctions": [ "Minimum" ]
|
|
|
Post by mraineri on May 26, 2022 11:21:49 GMT
It depends on whether or not you want to convey the max size of the array to the client in the GET response. In the "Array properties" clause, there is the following statement: "Services may pad an array property with null elements at the end of the sequence to indicate the array size to clients."
So, if you do want to convey the max size of the array to the client, then pad it with nulls. If you do not need to convey the max size of the array to the client, then simply return "SupportedCollectionFunctions": [ "Minimum" ].
|
|
|
Post by AMI_archerwen on Aug 25, 2022 11:35:50 GMT
Hi, Here is one more questions. We all know the array property have three types. Like the definition of "Rigid", here is said "An element that is removed from a rigid array shall be replaced by a null element and all other elements shall remain at their current index." But like below have a place mentioned "A PATCH request with fewer elements than in the current array shall remove the remaining elements of the array." So here is a example. I assume below property is "rigid array". "ABC": [ "a", "b", "c", "d", "e" ] if I PATCH like below request (Do not PATCH any null). "ABC": [ "c", "d", "e" ] As my understand, the response will like below. Am I correct? "ABC": [ "c", "d", "e", null, null ] Thanks, Archer.
|
|
|
Post by AMI_archerwen on Sept 5, 2022 3:25:35 GMT
Hi, Is any update?
|
|
|
Post by mraineri on Sept 6, 2022 13:07:18 GMT
That's correct; you would remove the rest of the array like with other arrays. The statement "A PATCH request with fewer elements than in the current array shall remove the remaining elements of the array." applies to all types of arrays.
|
|
|
Post by AMI_archerwen on Sept 7, 2022 10:06:46 GMT
Thanks for the reply.
|
|