My json:
{ "d": { "a": { "someId": null, "e": "8" }, "p": { "m": "t" } } } I am using
gson.fromJson(ResourceUtils.getStringFromInputStream(inputStream), MyClass.class); MyClass
{ public D d; } D { public A a; public P p; } A { public String someId; public String e; } P { public String m; } But when I run it:
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected STRING but was NULL at path $.someId So basically I want to create an object from the json file in android app. I am using gson for that. But the null value isn't getting set properly.