This forum is now read-only. Please use our new forums at discuss.codecademy.com.

How to use APIs with Python Forum

View Course » View Exercise

551 points
57aa9b0553c3ee14e27065dc79c4fcd0?s=140&d=retro
Submitted by
Weston Neal
over 4 years ago

Invalid JSON?

This is the original code from the 4th question of the review.

{
  "Cartoon Foxes": {
    {
      "Name": "Fox Tall",
      "Job": "Bein' tall"
    },
    {
      "Name": "Fox Small",
      "Job": "Bein' small"
    }
  }
}

Shouldn't "Cartoon Foxes" be an array? I am almost positive that as the code sits, it is invalid JSON.

{
  "Cartoon Foxes": [
    {
      "Name": "Fox Tall",
      "Job": "Bein' tall"
    },
    {
      "Name": "Fox Small",
      "Job": "Bein' small"
    }
  ]
}

0 votes

permalink

You are correct. The Codecademy's JSON is invalid and yours is valid.

I checked them both at http://jsonlint.com/

1454 points
A12beb37a2f7095c0f6dfb3d2545f301?s=140&d=retro
Submitted by
JScruffy
over 4 years ago