Is there an elegant way to get Gson an Kotlin’s de...
# random
d
Is there an elegant way to get Gson an Kotlin’s default values to play nicely?
g
Not really. Only if you have default constructor aka add default values to all arguments, in this case Kotlin will generate default constructor and Gson will use it to create an object instead of java.misc.Unsafe that bypass constructor invocation (including default value initialization)
d
@gildor I figured as much. Looks like an anti corruption layer is the best answer here. Thanks!
g
There are some solution that generate Kotlin-specific adapters, not sure about Gson tho