StevenMpls StevenMpls - 3 years ago 165
JSON Question

Unexpected character sequence in member name

For the life of me I cannot figure out what is wrong with this json data. Visual Studio says: "Unexpected character sequence in member name", online validators say similar. Any help would be appreciated! Thanks.

{
{
"id": 0,
"flair": "LowerFlair",
"flairtext": "Give it up!",
"min": 0,
"max": 0.200
},
{
"id": 1,
"flair": "LowerMiddleFlair",
"flairtext": "You might need more batting practice",
"min": 0.201,
"max": 0.249
}
}

Answer Source

That's because you have an object inside another object, in your case you should have a key:value, ex:

{
  "records":[
   {
     "id": 0,
     "flair": "LowerFlair",
     "flairtext": "Give it up!",
     "min": 0,
     "max": 0.200
   },
   {
     "id": 1,
     "flair": "LowerMiddleFlair",
     "flairtext": "You might need more batting practice",
     "min": 0.201,
     "max": 0.249
   }
  ]
 }

or an array:

[
   {
     "id": 0,
     "flair": "LowerFlair",
     "flairtext": "Give it up!",
     "min": 0,
     "max": 0.200
   },
   {
     "id": 1,
     "flair": "LowerMiddleFlair",
     "flairtext": "You might need more batting practice",
     "min": 0.201,
     "max": 0.249
   }      
 ]
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download