“Expected BEGIN_OBJECT but was STRING at line 1 column 1”

前端 未结 14 2205
误落风尘
误落风尘 2020-11-22 01:11

I have this method:

public static Object parseStringToObject(String json) {
    String Object = json;
    Gson gson = new Gson();
    Object objects = gson.f         


        
14条回答
  •  北海茫月
    2020-11-22 01:51

    Even without seeing your JSON string you can tell from the error message that it is not the correct structure to be parsed into an instance of your class.

    Gson is expecting your JSON string to begin with an object opening brace. e.g.

    {
    

    But the string you have passed to it starts with an open quotes

    "
    

提交回复
热议问题