Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gson serialized integers to decimals #1313

Closed
HyggeBo7 opened this issue May 9, 2018 · 1 comment
Closed

Gson serialized integers to decimals #1313

HyggeBo7 opened this issue May 9, 2018 · 1 comment

Comments

@HyggeBo7
Copy link

HyggeBo7 commented May 9, 2018

A json string containing an integer, serialized into an Object, how to avoid the integer into a decimal.

Source code:
String data = "[{"Id":1,"Type":"root","Key":"root"},{"Id":2,"Type":"root"},{"Id":3,"Type":"root"}]";

List dataList = gson.fromJson(data, new TypeToken<List>() {}.getType());

image

@HyggeBo7 HyggeBo7 changed the title Gson 序列化整数变成小数 Gson serialized integers to decimals May 9, 2018
@eamonnmcmanus
Copy link
Member

Fixed by #1290.

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

No branches or pull requests

2 participants