Skip to content

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

@Marcono1234

Description

@Marcono1234

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions