tahu
tahu copied to clipboard
Decoding Array types in javascript sparkplug-payload
The javascript/typescript library is missing support to decode metrics of array types. When trying to decode payload containing a metric with type StringArray, value will be decoded to null, and no type is set on the metric.
{
"timestamp": 1672576620000,
"metrics": [
{
"name": "StringArray-Metric",
"timestamp": 1672576620000,
"type": "StringArray",
"value": [
"abc",
"bca"
]
}
],
"seq": 1
}
{
"timestamp": 1672576620000,
"metrics": [
{
"value": null,
"name": "StringArray-Metric",
"timestamp": 1672576620000
}
],
"seq": 1
}