I have json object with arbitary values inside. And I want to deserialize it in a Map. Everything is ok except converting integers to a doubles. See example:
JSON only has a single Number type and there is no way for the parser to automatically tell what type to convert it to.
If you aren't going to use a strongly typed object graph, consider using the JsonElement types:
JsonObject root = new Gson().fromJson(json, JsonObject.class);
int num = root.getAsJsonObject("inner_obj").get("num").getAsInt();