Question 400
An engineer sends the string 'True' and 'False' as JSON Boolean values in a configuration payload. What is the best implementation or corrective action?
Explanation
Correct Answer
JSON Boolean values are true and false, not Python Boolean spellings. A direct operational check is: The controller accepts the intended Boolean data types instead of text.
Incorrect Answers
That action addresses a different condition: a RESTCONF request body uses single quotes for object keys and is rejected as malformed JSON. JSON syntax requires double quotes for object member names and string literals.
That action addresses a different condition: an API expects a numeric MTU but a generated JSON payload sends "1500" as a string. JSON distinguishes number and string values for validation.
That action addresses a different condition: a script emits a trailing comma after the last JSON list element and the API returns a parser error. Strict JSON syntax does not allow trailing commas in arrays or objects.