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

JsonAdapter nullSafe parameter is ignored by JsonSerializer/JsonDeserializer type adapters #1553

Closed
bufistov opened this issue Jul 17, 2019 · 0 comments · Fixed by #1555
Closed
Labels

Comments

@bufistov
Copy link
Contributor

Hi there,

It looks like gson uses TreeTypeAdapter for JsonSerializer/JsonDeserializer type adapters.
TreeTypeAdapter is always nullSafe, so nullSafe value of JsonAdapter annotation is ignored in this case which is at least confusing.

I fixed this locally by adding nullSafe parameter to the TreeTypeAdapter and would love to submit a PR if it need be. Shall I go ahead?

Thanks!

bufistov pushed a commit to bufistov/gson that referenced this issue Jul 19, 2019
The JsonSerializer/Deserializer adapters used to ignore this attribute
which result in inconsistent behaviour for annotated adapters.

Fixes google#1553

Signed-off-by: Dmitry Bufistov <dmitry@midokura.com>
@Marcono1234 Marcono1234 added the bug label Aug 2, 2022
eamonnmcmanus pushed a commit that referenced this issue Aug 5, 2022
The JsonSerializer/Deserializer adapters used to ignore this attribute
which result in inconsistent behaviour for annotated adapters.

Fixes #1553

Signed-off-by: Dmitry Bufistov <dmitry@midokura.com>

Co-authored-by: Dmitry Bufistov <dmitry@midokura.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants