JsonMappingException: out of START_ARRAY token

后端 未结 4 2158
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 04:37

Given the following .json file:

[
    {
        \"name\" : \"New York\",
        \"number\" : \"732921\",
        \"center\" : [
                \"latitude\"         


        
4条回答
  •  情书的邮戳
    2020-11-28 05:17

    Your JSON string is malformed: the type of center is an array of invalid objects. Replace [ and ] with { and } in the JSON string around longitude and latitude so they will be objects:

    [
        {
            "name" : "New York",
            "number" : "732921",
            "center" : {
                    "latitude" : 38.895111, 
                    "longitude" : -77.036667
                }
        },
        {
            "name" : "San Francisco",
            "number" : "298732",
            "center" : {
                    "latitude" : 37.783333, 
                    "longitude" : -122.416667
                }
        }
    ]
    

提交回复
热议问题