...
Public Interfaces
Add a configuration two configurations to JsonConverter:
Name: serialize.use.optional.null
Description: Whether to serialize fields that have a default value and that are null to the default value or to null. When set to .defaultfalse, the default value is used, otherwise null is used.
Type: Boolean
Default: false
Name: deserialize.use.optional.null
Description: Whether to serialize deserialize fields that have a default value and that are null to the default value or to null. When set to truefalse, the default value is used, otherwise null is used.
Type: Boolean
Default: truefalse
Proposed Changes
Update JsonConverter and JsonConverterConfig to handle the new configurationconfigurations.
Compatibility, Deprecation, and Migration Plan
The new configuration keeps configurations keep the current behavior by default so it will not affect existing users. Users can optionally opt-in the new behavior by setting the configuration to falsetrue.
Rejected Alternatives
null
on an optionalnull