tahu icon indicating copy to clipboard operation
tahu copied to clipboard

Decoding Array types in javascript sparkplug-payload

Open Jocke-G opened this issue 1 year ago • 0 comments

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.

Stackblitz

{
  "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
}

Jocke-G avatar Sep 21 '23 14:09 Jocke-G