JsonMappingException: out of START_ARRAY token

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

Given the following .json file:

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


        
4条回答
  •  天涯浪人
    2020-11-28 05:37

    JsonMappingException: out of START_ARRAY token exception is thrown by Jackson object mapper as it's expecting an Object {} whereas it found an Array [{}] in response.

    This can be solved by replacing Object with Object[] in the argument for geForObject("url",Object[].class). References:

    1. Ref.1
    2. Ref.2
    3. Ref.3

提交回复
热议问题