Using list and tuple for array

When array is selected for Type, the Element Mode list has two options:

  • list: All elements in array are the same definition.

    The items that are defined for list apply to all elements that are under this array node in a JSON message.

    Example definition:

    {
        "type": "array",
        "items": {
             "type": "number"
        }
    }    

    A correct message is: [1, 2, 3, 4, 5]

    An incorrect message is: [1, 2, “3”, 4, 5]

  • tuple: Each element in array can be another definition.

    You must define an item under tuple for each element under this array node in a JSON message. The order should be the same.

    Example definition:

    {
        "type": "array",
        "items": [
            { "type": "number" },
            { "type": "string" },
            { "type": "string" },
            { "type": "string" }
         ]
    }    

    A correct message is: [1600, "Pennsylvania", "Avenue", "NW"]

    An incorrect message is: ["Pennsylvania "] or ["Sussex", 24, "Drive"] (The first element should be a number.)