-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Use Gson @SerializedName annotation on ALL fields, even when JSON name matches Java name #327
Comments
This should already be supported. Could you explain more about how you're
|
I am using the online tool. By checking the Gson annotation style box, I do have |
Ah, I see what you mean. Feel free to submit a pull request for this. |
Hi , The @SerializedName doesnt seem to be working for an int value. I'm using java 8 and gson2.2.3. Any suggestions would be of great help. |
@PNagesh I could be wrong, but I don't think you have diagnosed the problem correctly here. There's no reason that |
gson uses
@SerializedName("json_name")
when the name of the json field and the name of the java field are different. (already present to do the snake case to camel case)It is also useful when the java code is obfuscated and the name of the java field is modified.
The text was updated successfully, but these errors were encountered: