CCNA 200-301 v1.1 reference — Automation and Programmability
JSON-encoded data
JSON objects, arrays and primitive types, nesting and syntax rules, and how to recognize valid versus invalid structures.
Objective 6.7v1.1 exam target
Loading
Objects, arrays and primitives
JSON (JavaScript Object Notation) is the dominant data-encoding format for APIs and configs: human-readable text representing objects {…} (key→value pairs), arrays […] (ordered lists), and primitives — string, number, boolean, null.
JSON components
| Component | Syntax | Example |
|---|---|---|
| Object | { "key": value, ... } | {"vlan": 20} |
| Array | [ value, value ] | [10, 20, 30] |
| String | "quoted" | "access" |
| Number | bare digits | 1500 or -3.5 |
| Boolean | true / false | "enabled": true |
| null | null | "gateway": null |
$ Annotated JSON
{Object open. "interface": "GigabitEthernet0/1",String value — quotes required. "enabled": true,Boolean — lowercase, unquoted. "vlans": [10, 20, 30],Array of numbers. "description": null,Null — explicit empty. "ipv4": { "address": "192.168.10.1", "prefix": 24 }Nested object.}No trailing comma allowed.Valid versus invalid
Syntax errors that invalidate JSON
| Mistake | Why invalid |
|---|---|
| Trailing comma | { "a": 1, } — JSON forbids them |
| Single quotes | 'text' — strings require double quotes |
| Unquoted keys | { vlan: 20 } — keys must be strings |
| Comments | // note — JSON has no comments |
| True/None capitalization | True, None — must be true, false, null |
Validate a response fragment
- Candidate
- { "interfaces": [ { "name": "Gi0/1", "up": true, } ] }
- The object inside the array has a trailing comma after
true. - That single comma makes the whole document invalid JSON — a strict parser rejects it.
- Fix: remove the comma →
{ "name": "Gi0/1", "up": true }.
Strict syntax is the contract — one stray comma breaks the parse.
Verification
Verification cues
- Use a parser, not eyes:
python -m json.toolpretty-prints valid JSON or names the failing line. - Numbers vs strings matter:
"vlan": "20"and"vlan": 20are different types — API schemas enforce them. - Nesting depth is free-form — validate structure against the API's schema, not a guess.
Common mistakes
- Reading
{ }as an array — braces are objects, brackets are arrays. - Adding trailing commas or comments — both are hard syntax errors.
- Confusing JSON with Python dict reprs —
None/Truedon't exist in JSON. - Assuming key order is preserved/semantically meaningful — objects are unordered.
API rejects a hand-edited payload
Observation: A curl POST returns 'invalid JSON' after a small manual edit.
Hypotheses
- Trailing comma or unquoted key introduced
- Smart quotes pasted from a document editor
- A comment or trailing text left outside the structure
| Check | Indicates |
|---|---|
Run python -m json.tool on the payload | Parser names the exact line/column of failure. |
| Diff against the last working version | The edit introduced the invalid element. |
Correction: Fix the syntax issue the parser reports.
The same payload parses cleanly, matches the schema, and the API accepts it.
Sources
- Cisco CCNA 200-301 v1.1 Exam Topics (official PDF) — reviewed 2026-11-02
- RFC 8259 — The JavaScript Object Notation (JSON) Data Interchange Format — reviewed 2026-11-02
Targets CCNA 200-301 v1.1 objectives. Supplemental blocks are labeled beyond exam scope.