-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"Explicit" nulls within RuntimeTypeAdapterFactory
Using custom TypeAdapters, it is possible to force null values within a particular type to be explicitly serialized, by overriding the setSerializeNulls setting on the supplied JsonWriter. However, this behavior fails in the context of a RuntimeTypeAdapterFactory because a second JsonTreeWriter is used and settings are not propagated from one to the other. This change fixes this by: - propagating the original setSerializeNulls setting to the created JsonTreeWriter - temporarily forcing the setSerializeNulls setting to true on the oriiginal JsonWriter to ensure any explicit nulls are preserved. Issue #676
- Loading branch information
Showing
2 changed files
with
118 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters