You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation for the GsonBuilder.registerTypeAdapter method has been adjusted by #1704 and the incorrect behavior when used with @JsonAdapter has been fixed by #1555. I am therefore closing this issue here (especially since it was not mentioned for which use case this behavior caused issues). #852 is still open, and maybe it can also be considered to add new GsonBuilder methods which allow registering JsonSerializer or JsonDeserializer without making them null-safe. For now the workaround is to use TypeAdapter or TypeAdapterFactory instead, if possible.
TreeTypeAdapter.java
/**
@OverRide public T read(JsonReader in) throws IOException {
if (deserializer == null) {
return delegate().read(in);
}
JsonElement value = Streams.parse(in);
if (value.isJsonNull()) {
return null;
}
return deserializer.deserialize(value, typeToken.getType(), context);
}
**/
The text was updated successfully, but these errors were encountered: