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

Clarify that GsonBuilder.registerTypeAdapter makes JsonSerializer and JsonDeserializer null-safe #1697

Closed
Marcono1234 opened this issue May 20, 2020 · 0 comments · Fixed by #1704

Comments

@Marcono1234
Copy link
Collaborator

Marcono1234 commented May 20, 2020

When calling GsonBuilder.registerTypeAdapter with a JsonSerializer or JsonDeserializer, it is made null-safe (see TreeTypeAdapter), i.e. the (de-)serializer will not be consulted when a null value is handled.

It appears this is currently not documented.

It should be documented in registerTypeAdapter and it should refer to TypeAdapter as alternative which does allow handling null-values.

Related: #1553, #980, #852

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