Skip to content

JSON MTConnectStreams response inconsistent use of array #275

@scottmwyant

Description

@scottmwyant

Agent v2.0.0.12

This is probably more of a question initially, a bug only if this is not the intended behavior.

The ToolNumber shown here is a key in an Events object (within a ComponentStream). Usually, an event type will be associated with multiple observations, so naturally, we get an array. I'm questioning the behavior when there is only one observation; the observation is returned as a scalar, but I would expect a single-element array.

Actual:

"ToolNumber": {
    "dataItemId": "cnc2_p7_tool_num",
    "sequence": 2747897,
    "timestamp": "2023-02-17T04:32:48.035Z",
    "value": "1"
},

Expected:

"ToolNumber": [
    {
        "dataItemId": "cnc2_p7_tool_num",
        "sequence": 2747897,
        "timestamp": "2023-02-17T04:32:48.035Z",
        "value": "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