Bird
0
0

Identify the issue in this JSON snippet:

medium📝 Debug Q7 of 15
Rest API - Request and Response Format
Identify the issue in this JSON snippet:
{"status": "ok", "items": [1, 2, 3],}
AMissing quotes around the key "status"
BTrailing comma after the last array element
CArray elements must be strings, not numbers
DKeys cannot be strings in JSON
Step-by-Step Solution
Solution:
  1. Step 1: Review JSON syntax rules

    JSON does not allow trailing commas after the last element in arrays or objects.
  2. Step 2: Inspect the snippet

    The comma after the last array element '3' is invalid.
  3. Final Answer:

    Trailing comma after the last array element -> Option B
  4. Quick Check:

    Trailing commas are not allowed in JSON [OK]
Quick Trick: No trailing commas allowed in JSON arrays or objects [OK]
Common Mistakes:
  • Allowing trailing commas in JSON
  • Confusing JSON keys with non-string types
  • Assuming numbers must be strings in arrays

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes