java123999 java123999 - 24 days ago 8
JSON Question

JSON: Parse error?

{
"employees": [{
"firstName": "string",
"lastName": "string"
}]
"departmentCode": "integer",
"errorMessage": "string"
}


When trying to validate the
JSON
above using this online tool , I get the error:

Error: Parse error on line 5:


I am very new to JSON, What is wrong with this JSON syntax?

Answer

Just Try this. You have missed the "," after employee JSON array

{
 "employees": [{
    "firstName": "string",
    "lastName": "string"
              }],
 "departmentCode": "integer",
 "errorMessage": "string"
}
Comments