我将改装库从1.9升级到2.3,然后我遇到了这个问题:
预计BEGIN_OBJECT但是STRING在第1行第1660行路径$ .data [2] .activities [0] .at
我错误提到的JSON部分是:
{
"doc_key": "a_S1EBp3_Z",
"title": "Awesome Diving",
"description": "If you were given one week to dive and could choose any scuba diving sites in the world with which to fill your logbook, where would you go? We asked a number of underwater photographers, writers and our readers, and got a remarkable sampling of dives that cover just about everything this planet has to offer. From the remarkable macro of Lembeh Strait to the shark dives of the Bahamas, magical reefs in Fiji and wrecks in the Red Sea, there are plenty of sites you’d expect to see, but an even greater number of surprises.",
"price": 0,
"images": [
"main.jpg",
"ryfoaYLmx.jpg",
"BJlMipFLmg.jpg"
],
"has_attended": false,
"at": "2017-08-31T13:00:00+04:30",
"attendees": [],
"total_attendees": 0,
"hostel_name": "Pasargad"
}
我使用Gson解析Json,我的模型是:
public class Activity {
@SerializedName("doc_key")
@Expose
private String docKey;
@SerializedName("title")
@Expose
private String title;
@SerializedName("description")
@Expose
private String description;
@SerializedName("price")
@Expose
private Integer price;
@SerializedName("images")
@Expose
private List<String> images = null;
@SerializedName("has_attended")
@Expose
private Boolean hasAttended;
@SerializedName("at")
@Expose
private DateTime at;
@SerializedName("attendees")
@Expose
private List<Attendee> attendees = null;
@SerializedName("total_attendees")
@Expose
private Integer totalAttendees;
@SerializedName("hostel_name")
@Expose
private String hostelName;
private String address;
private Hostel hostel;
private Location location;
我用验证器检查我的JSON,但我认为JSON中应该存在一些问题。