JNCIA-DevOps Data Serialization Practice Question
You are writing a Python script to convert a complex Juniper device inventory from YAML format into JSON format using PyYAML and the built-in json module. Which THREE considerations must you keep in mind regarding differences between YAML and JSON during this conversion? (Choose three)
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
YAML allows unquoted strings for most values, whereas JSON strictly requires double quotes for all string literals.
JSON does not support comments, requires double quotes for strings/keys, and only permits string keys in objects, whereas YAML allows comments, optional quotes, and non-string keys.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
YAML allows unquoted strings for most values, whereas JSON strictly requires double quotes for all string literals.
Why this is correct
YAML allows plain unquoted strings in many contexts, but JSON requires explicit double-quote wrapping.
- ✓
Comments present in the YAML file will be automatically discarded during conversion to JSON because JSON does not support comments.
Why this is correct
Since JSON lacks comment support, any comments in the YAML source are stripped out when converting to JSON.
- ✗
YAML anchors and aliases will be automatically preserved as native references in the resulting JSON output.
Why it's wrong here
JSON does not have a native concept of anchors and aliases, so PyYAML resolves them into duplicated data structures during parsing.
- ✓
YAML scalar keys that are integers or booleans will be converted to string keys in JSON, as JSON object keys must be strings.
Why this is correct
JSON object keys are strictly restricted to strings, forcing numeric or boolean keys from YAML to be coerced to strings.
- ✗
JSON supports multi-document streams natively in a single file just like YAML.
Why it's wrong here
Standard JSON represents a single root document per file, unlike YAML which natively supports multi-document files using '---'.
About these practice questions
This JNCIA-DevOps question is part of Courseiva's 307-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Juniper Networks exam blueprint
This JNCIA-DevOps practice question is part of Courseiva's free Juniper Networks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the JNCIA-DevOps exam.