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

Unable to Serialize null field #67

Closed
dkpalmer opened this issue Sep 14, 2016 · 1 comment
Closed

Unable to Serialize null field #67

dkpalmer opened this issue Sep 14, 2016 · 1 comment

Comments

@dkpalmer
Copy link

dkpalmer commented Sep 14, 2016

I have a need to serialize a null field. When I mark the field as @Nullable, I see the GsonTypeAdapter write(JsonWriter, Object) method wrap the field adapter's write() call in a null check. But if I remove @Nullable, my builder/factory methods complain about the null value. Is there any way around this?

It looks like 23 could be related?

For clarity, I am calling serializeNulls in my GsonBuilder. Perhaps the write method's GsonTypeAdapter could check that flag in the JsonWriter to bypass the above mentioned null check?

ansman pushed a commit to ansman/auto-value-gson that referenced this issue Oct 24, 2016
ansman added a commit to ansman/auto-value-gson that referenced this issue Oct 24, 2016
ansman added a commit to ansman/auto-value-gson that referenced this issue Oct 24, 2016
rharter pushed a commit that referenced this issue Oct 25, 2016
@ZacSweers
Copy link
Collaborator

Closed by #78

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

2 participants