Empty json object instead of null, when no data -> how to deserialize with gson
问题 I am trying to parse json data with Google's gson library. But the json data doesn't behave well. It does look like this when everything is alright: { "parent": { "child_one": "some String", "child_two": "4711", ... } } child_one should be parsed as String , child_two as int . But sometimes one of the children has no values what results in an empty object instead of null , like this: { "parent": { "child_one": "some String", "child_two": {}, ... } } I have no access to alter the json feed, so