A JSON array is an ordered set of JSON values enclosed in square brackets. Arrays organize lists inside JSON objects and can contain primitive values, objects, or other arrays. section 24.2.2 section 24.4
Apply these syntax and interpretation rules:
- Enclose the values in square brackets. section 24.4
- Separate values with commas, but do not add a trailing comma after the final value. section 24.4
- Allow values of different JSON data types in the same array. section 24.4
- Preserve ordering, while treating whitespace as irrelevant to data interpretation. section 24.2.2
- Close every array with a square bracket; omitting one makes the JSON invalid. section 24.2.3
Mixed values and nested configuration
The `interfaces` array contains three strings, while `random_values` contains a string, number, Boolean, and null: { "interfaces": ["GigabitEthernet1/1", "GigabitEthernet1/2", "GigabitEthernet1/3"], "random_values": ["Hi", 42, false, null] }. section 24.2.2
{
"interfaces": [ #1
"GigabitEthernet1/1", #1
"GigabitEthernet1/2", #1
"GigabitEthernet1/3" #1
], #1
"random_values": [ #2
"Hi", #2
42, #2
false, #2
null #2
] #2
}
Inspect a compact example showing ordered interface names and heterogeneous JSON values. section 24.2.2


