2016-11-11 246 views
-3
{ 
    "employees": [{ 
     "firstName": "string", 
     "lastName": "string" 
    }] 
    "departmentCode": "integer", 
    "errorMessage": "string" 
} 

當試圖驗證JSON上面使用這個online tool,我得到的錯誤:JSON:解析錯誤?

Error: Parse error on line 5: 

我是很新的JSON,什麼是錯的這個JSON語法?

+3

在'}]'後面缺少一個逗號'。以下是開始使用JSON語法規則的文檔http://stackoverflow.com/documentation/json/889/getting-started-with-json/9864/json-syntax-rules – user2314737

回答

1

試試這個。您錯過了employee JSON數組後employee

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