JN0-223 practice question 3 of 15

Which statement is valid regarding YAML and JSON?

Full set: 66 questions
Answer options
A: YAML and JSON use indentation.
B: White space is ignored in YAML and JSON.
C: Comments are available in YAML and JSON.
D: YAML and JSON are case-sensitive. Correct answer
Correct Answer:
D. YAML and JSON are case-sensitive.
Explanation

Both YAML and JSON are case-sensitive data serialization formats. In both, keys are treated as strings, and string comparisons are performed in a case-sensitive manner. This means that a key named interface is distinct from a key named Interface. This characteristic is fundamental to how parsers interpret the data structure and access specific key-value pairs.

Why Incorrect

A. YAML and JSON use indentation. Only YAML relies on indentation to denote structure and nesting. JSON uses braces {} and brackets [] for structure and ignores indentation and whitespace between tokens.
B. White space is ignored in YAML and JSON. This is incorrect for YAML, where whitespace (specifically indentation) is syntactically significant. While JSON ignores whitespace between tokens, it is not a universally true statement for both.
C. Comments are available in YAML and JSON. YAML supports single-line comments starting with a hash symbol (#). The official JSON specification (RFC 8259) does not include a syntax for comments.

References

1. YAML Ain’t Markup Language (YAML™) Version 1.2 (3rd Edition

2009-10-01):

Section 3.2.1.2. Node Comparison: "By default

scalars are compared by case-sensitive string comparison." This confirms case-sensitivity for YAML keys (which are scalars).

Section 6.1. Indentation Spaces: "In YAML

indentation is used to denote structure." This refutes options A and B.

Section 3.2.3.3. Comments: "Comments in YAML begin with an octothorpe (#)." This refutes option C.

2. The JavaScript Object Notation (JSON) Data Interchange Format

IETF RFC 8259 (December 2017):

Section 4. Objects: Defines object member names (keys) as strings. String comparison is inherently case-sensitive

making JSON keys case-sensitive.

Section 2. White Space: "Insignificant white space is allowed before or after any of the six structural characters." This confirms whitespace is ignored for structure

refuting option A.

The specification provides no syntax or mention of comments

confirming they are not a standard feature

which refutes option C.

3. Juniper Networks

Day One: Data Serialization for Network Automation (1st Edition

2021):

Chapter 3

An Introduction to YAML

Page 28: "YAML is case sensitive." and "YAML uses indentation to indicate structure."

Chapter 2

An Introduction to JSON

Page 16: The chapter implicitly demonstrates through examples that JSON keys are case-sensitive strings and that the format does not support comments.

Scroll to Top