Skip to content

Decoding Array types in javascript sparkplug-payload #317

@Jocke-G

Description

@Jocke-G

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions