Question 530
While diagnosing a reported campus or branch issue for json types and syntax, the following requirement is recorded: An engineer leaves a trailing comma after the final array element and parsing fails. What is the most appropriate action?
Explanation
Correct Answer
Remove the trailing comma to produce valid JSON. RFC 8259 JSON does not permit trailing commas.
Incorrect Answers
This alternative, Encode the value as true or false without quotation marks, fits: An automation payload represents an interface enabled flag and must use JSON boolean syntax. JSON booleans are lowercase literals rather than Python True/False.
Encode the value with JSON null when a null is supported belongs to a different case: A payload needs to represent a missing optional interface description. JSON null represents no value rather than the string "null".
Encode a JSON object with quoted keys and a colon between each key and value is not the precise answer here. It addresses: An API expects an object with two named properties.