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