Bird
0
0

Identify the error in this JSON string:

medium📝 Debug Q6 of 15
Rest API - Request and Response Format
Identify the error in this JSON string:
{"name": "John", age: 30}
AMissing quotes around the key 'age'
BMissing comma between items
CExtra comma at the end
DIncorrect use of single quotes
Step-by-Step Solution
Solution:
  1. Step 1: Check JSON key syntax

    All keys must be in double quotes in JSON.
  2. Step 2: Identify the missing quotes

    The key age is not in quotes, causing invalid JSON.
  3. Final Answer:

    Missing quotes around the key 'age' -> Option A
  4. Quick Check:

    JSON keys require double quotes [OK]
Quick Trick: Always put double quotes around JSON keys [OK]
Common Mistakes:
  • Using single quotes for keys
  • Omitting quotes on keys
  • Confusing JSON with JavaScript object syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes