Top "Gson" questions

Gson is Google's open-source library for serializing and deserializing Java objects to/from JSON.

Gson to HashMap

Is there a way to convert a String containing json to a HashMap, where every key is a json-key and …

java android gson
Gson: @Expose vs @SerializedName

With respect to Gson what is the difference between @Expose and @SerializedName("stringValue")?

java android json gson
How to prevent Gson from expressing integers as floats

Gson has some odd behavior when I try to convert a string to json. The code below transforms string draft …

java android gson
Retrofit2.0 gets MalformedJsonException while the json seems correct?

I am using retrofit:2.0.0-beta4 for my android app. I tried to add a user with Retrofit, the user is …

android json gson retrofit retrofit2
Gson - Automatic quote (") escaping?

I'm using GSON on my Java EE server to provide some json to views. In some object, I have long …

java json gson
Struts2 How to Return a JSON Response

I am currently creating a web-application where the users can fetch tags from the database as JSON, here is my …

java json struts2 action gson
App crashes (sometimes) with Fatal signal 11 (SIGSEGV), code 1

I am developing an app with the HERE SDK, and everything worked fine until now. I get errors like this …

android gson here-api segmentation-fault
Why does GSON use fields and not getters/setters?

Why does GSON use ONLY fields(private,public,protected)? Is there a way to tell GSON to use only getters …

java gson
How to handle a NumberFormatException with Gson in deserialization a JSON response

I'm reading a JSON response with Gson, which returns somtimes a NumberFormatException because an expected int value is set to …

java json deserialization gson
How to use TypeToken + generics with Gson in Kotlin

I'm unable to get a List of generic type from a custom class (Turns): val turnsType = TypeToken<List<…

generics gson kotlin typetoken