-
Notifications
You must be signed in to change notification settings - Fork 667
Closed
Labels
Description
When deserializing a json and we get a null value passed down, an annotation/setting should be allowed to instead use the default value. The following scenario will fail if deserialize because it is looking for a non-null value
{
"name": "john",
"number": null
}
data class Person(val name: String = "", val number: String ="")
If we had an annotation that specified to use default if null, the the following would deserialize correctly using the default value.
{
"name": "john",
"number": null
}
data class Person(val name: String = "", @UseDefault val number: String ="")
If this exists then please point me to the documentation :) Thanks.
ilgonmic, turansky, aerialist7, CherniyFY, Shusek and 16 more