Bird
0
0

Why does JSON not allow comments inside its data format?

hard📝 Conceptual Q10 of 15
Rest API - Request and Response Format
Why does JSON not allow comments inside its data format?
ATo prevent security vulnerabilities
BBecause comments are not useful in data
CBecause JSON is only for numbers and strings
DTo keep the format simple and avoid parsing errors
Step-by-Step Solution
Solution:
  1. Step 1: Understand JSON design goals

    JSON aims to be a simple, lightweight data format easy to parse.
  2. Step 2: Reason about comments in data

    Allowing comments complicates parsing and can cause errors, so they are disallowed.
  3. Final Answer:

    To keep the format simple and avoid parsing errors -> Option D
  4. Quick Check:

    No comments in JSON to keep parsing simple [OK]
Quick Trick: JSON disallows comments to keep parsing simple [OK]
Common Mistakes:
  • Thinking comments are useless in data
  • Believing JSON only supports numbers and strings
  • Assuming comments cause security issues

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes