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

Provide annotation to rename an individual field #16

Closed
GoogleCodeExporter opened this issue Mar 19, 2015 · 3 comments
Closed

Provide annotation to rename an individual field #16

GoogleCodeExporter opened this issue Mar 19, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

I'd like the ability to control the name of a property being serialized on
a per-field basis using an annotation. Something like:

   @SerializeAsName("id")
   String getUniqueName() { ... }

Other alternatives are @Name, @Named, @JsonName, etc.

Original issue reported on code.google.com by viri...@gmail.com on 4 Jun 2008 at 10:09

@GoogleCodeExporter
Copy link
Author

This request is similar to Issue 9.

We should develop a generic naming policy that can handle both annotation based 
and
general field renaming (or a combination of naming policies).

Original comment by joel.leitch@gmail.com on 6 Jun 2008 at 12:30

@GoogleCodeExporter
Copy link
Author

Generic naming policy infrastructure has been added so now I need to hook in the
annotation based naming strategy.

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

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Feature request submitted in r104.  This change will be rolled out in the 1.1 
release.

See https://sites.google.com/site/gson/gson-roadmap for information on upcoming 
releases.

Original comment by joel.leitch@gmail.com on 30 Jun 2008 at 2:30

  • Changed state: Fixed
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

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