Automation and Artificial Intelligence

An engineer writes a JSON body for a RESTCONF request to set an interface description and state. Which version is valid JSON?

Show the answer

Correct answerD. {"name": "GigabitEthernet1", "enabled": true, "description": "Uplink"}

AWhy not this: Single quotes are valid in Python but JSON strings and keys must use double quotes.

BWhy not this: Capitalized True is a Python literal; JSON booleans must be lowercase true or false.

CWhy not this: A trailing comma after the last pair is not allowed in JSON and causes a parse error.

DWhy this is right: Double-quoted keys and strings, lowercase true, and no trailing comma make this valid JSON.

JSON requires double-quoted strings and keys, lowercase true/false literals, and no trailing comma. Only the version that meets all three rules is valid. Single quotes look valid because Python dictionaries accept them, but JSON does not.