liveBook · Manning

JSON array

As explained in Acing the CCNA Exam: Volume 2 Advanced Networking and Security

A JSON array is an ordered collection of JSON values enclosed in square brackets.

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

How Acing the CCNA Exam: Volume 2 Advanced Networking and Security covers it

How deep it goes
Defines delimiters, ordering, permitted value types, separators, whitespace, and invalid closing syntax.
Examples
Uses interface-name lists, mixed random values, allowed IP addresses, and firewall rules containing objects.
What it assumes
Assumes basic JSON primitive values while establishing structured data types and array syntax.
What you can do after
Evaluate JSON arrays, recognize their value types, and diagnose missing brackets or trailing commas.
How it connects
Connects arrays with JSON objects, nested data, REST APIs, XML, and YAML.

Also explained in

Compare how 3 books explain JSON array →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the CCNA Exam: Volume 2 Advanced Networking and Security. The section links point to the parts of the book it draws on.