这是我的服务器响应;
{
"data": {
"constants": [
{
"SIZECCbendRatio": "0.99"
},
{
"SIZECCminRatio": "1.45"
},
{
"SIZECCmaxRatio": "1.75"
}
],
"agent": "NO",
"status": "Success",
"message": "Did not find any agent information on User agent status was found"
}
}
我的服务器响应在这里返回一些参数和Json数组格式中的一些常量值。
public class GetAgentInfo {
@SerializedName("data")
public Data data;
public static class Data {
@SerializedName("constants")
public Constant constants;
@SerializedName("agent")
public String agent;
@SerializedName("status")
public String status;
@SerializedName("message")
public String message;
}
public static class Constant{
public Map<String,Object> values = new HashMap<String, Object>();
}
}
但是在Reponse上显示错误消息
java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 23 path $.data.constants..
我不知道我在哪里做错了,请提前帮助和感谢。
答案 0 :(得分:0)
常量是一个数组
public List<Constant> constants;