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

Would be useful to restrict serialization/deserialization with gson @Expose annotation #34

Closed
sschendel opened this issue Apr 26, 2016 · 4 comments

Comments

@sschendel
Copy link

We conditionally expose fields in our models with the @Expose annotation. GsonBuilder can be configured to recognize. Is there a plan to enable this feature with auto-value-gson extension?

public class MyModel {
   private long doNotExpose;   
  @Expose @SerializedName("expose_me") private long exposeMe;  
...
}
final Gson gson = new GsonBuilder()
   .excludeFieldsWithoutExposeAnnotation()
...
   .create();
@rharter
Copy link
Owner

rharter commented Apr 26, 2016

This will be taken care of when #18 is solved.

@rharter rharter closed this as completed Apr 26, 2016
@Rainer-Lang
Copy link

@rharter If you have to guess....when do you think this is "solved"?

@rharter
Copy link
Owner

rharter commented Apr 26, 2016

Just waiting on a PR in the gson repo to be released. It just got merged, so shouldn't be too long.

@Rainer-Lang
Copy link

@rharter Thanks for answer. I was a bit afraid because it is a PR of google/auto........

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

No branches or pull requests

3 participants