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 Mar 19, 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

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