this:https://github.com/google/gson/issues/1580 https://github.com/google/gson/issues/1257 https://github.com/google/gson/issues/1084 It is recommended to modify the ObjectTypeAdapter or allow to override the default implementation. like this: case NUMBER: String n = in.nextString(); if (n.indexOf('.') == -1) { return Long.parseLong(n); } return Double.parseDouble(n);