Skip to content

Gson serialized integers to decimals #1313

@HyggeBo7

Description

@HyggeBo7

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions