Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

JSON.toJavaObject can't be compatible #1178

Closed
lizhangqu opened this issue May 2, 2017 · 1 comment
Closed

JSON.toJavaObject can't be compatible #1178

lizhangqu opened this issue May 2, 2017 · 1 comment
Labels

Comments

@lizhangqu
Copy link

lizhangqu commented May 2, 2017

public class TestModel implements Serializable {
    public String info;
}
String json = "{\n" +
            " \"info\": {\n" +
            "        \"test\": \"\", \n" +
            "    }\n" +
            "}";

JSONObject jsonObject = JSON.parseObject(json);
TestModel loginResponse = JSON.toJavaObject(jsonObject, TestModel.class);

If I use the version <= 1.1.46.android,there is no problem.But if I use the version > 1.1.46.android, it will throw a JSONException(can not get javaBeanDeseriallizer)

I must write the modle like this when the version > 1.1.46.android

public class TestModel implements Serializable {
    public JSONObject info;
}

Is there any solution?

wenshao added a commit that referenced this issue May 2, 2017
wenshao added a commit that referenced this issue May 2, 2017
@wenshao wenshao added this to the 1.1.57.android milestone May 2, 2017
@wenshao wenshao added the bug label May 2, 2017
@wenshao
Copy link
Member

wenshao commented May 2, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants