【发布时间】:2015-03-16 22:35:35
【问题描述】:
一直在摸索这个问题。 JSON 响应是有效的:
{
"MRData": {
"xmlns": "http://ergast.com/mrd/1.4",
"series": "f1",
"url": "http://ergast.com/api/f1/current/2.json",
"limit": "30",
"offset": "0",
"total": "1",
"RaceTable": {
"season": "2014",
"round": "2",
"Races": [
{
"season": "2014",
"round": "2",
"url": "https://en.wikipedia.org/wiki/2014_Malaysian_Grand_Prix",
"raceName": "Malaysian Grand Prix",
"Circuit": {
"circuitId": "sepang",
"url": "http://en.wikipedia.org/wiki/Sepang_International_Circuit",
"circuitName": "Sepang International Circuit",
"Location": {
"lat": "2.76083",
"long": "101.738",
"locality": "Kuala Lumpur",
"country": "Malaysia"
}
},
"date": "2014-03-30",
"time": "08:00:00Z"
}
]
}
}
}
响应的 POJO:
public class ApiResponse {
MRData mrdata;
public class MRData {
String xmlns;
String series;
String url;
String limit;
String offset;
String total;
RaceTable raceTable;
}
}
apiResponse 对象始终为空。任何人都可以在这里指出 POJO 对象有什么问题? 谢谢。
【问题讨论】:
-
我们在使用
Gson反序列化 JSON 时遇到问题,发现区分大小写是罪魁祸首 stackoverflow.com/questions/13171058/…
标签: android json pojo retrofit