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 should provide an ability to customize field name mapping #9

Closed
GoogleCodeExporter opened this issue May 4, 2015 · 2 comments
Closed

Comments

@GoogleCodeExporter
Copy link

Currently Gson just uses the actual name of the field as the Json property
name. This should be customizable. For example, it should be possible to
convert camel-case into hyphenated, or Camel-cased with upper-case first
letter.

so, myFavoriteField in Java gets mapped to my-favorite-field or
MyFavoriteField in Json. 

One approach to achieve this is by providing a name translation policy in
GsonBuilder. 

Original issue reported on code.google.com by inder123 on 22 May 2008 at 5:51

@GoogleCodeExporter
Copy link
Author

Started implementing this feature.

This bug will be part of the next version cut (tentative date: July 4th).

Original comment by joel.leitch@gmail.com on 19 Jun 2008 at 1:37

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

r100 contains the code to support this feature.

Original comment by joel.leitch@gmail.com on 28 Jun 2008 at 4:46

  • Changed state: Fixed

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

No branches or pull requests

1 participant