我有这种JSON格式:
["com.atlassian.greenhopper.service.sprint.Sprint@60d1cf92[id=636,rapidViewId=69,state=CLOSED,name=ABC-1,startDate=2016-07-18T08:22:00.000-04:00,endDate=2016-07-29T04:15:00.000-04:00,completeDate=2016-08-09T10:34:24.009-04:00,sequence=636]", "com.atlassian.greenhopper.service.sprint.Sprint@461fc487[id=656,rapidViewId=69,state=ACTIVE,name=ABC-2,startDate=2016-08-09T10:42:41.342-04:00,endDate=2016-08-19T06:35:00.000-04:00,completeDate=<null>,sequence=656]"]
我正在尝试使用Gson解析来解析它,但得到这个Expected BEGIN_OBJECT but was STRING at line 1 column 3 path $[0]
。
Java片段和用于解析的Spring bean如下:
Type sprintBeanType = new TypeToken<List<SprintBean>>() {}.getType();
List<SprintBean> sprintBeanList = gson.fromJson(json, sprintBeanType);
public class SprintBean{
@Expose
private String sprint;
public String getSprint() {
return sprint;
}
public void setSprint(String sprint) {
this.sprint = sprint;
}
}
非常感谢您解析此JSON的任何帮助。