Don't mean to get this conversation started again ...
# squarelibraries
c
Don't mean to get this conversation started again as it seems like null values overriding default values in Kotlin has pretty much been decided that Moshi will stick with that behavior, but is there any chance to get a config/builder option to opt out of that behavior? Pretty much this ticket https://github.com/square/moshi/issues/843 I've got a huge project that is migrating from gson to moshi and this is now becoming an issue, but we don't really want to update like 100+ response models so we're looking for an answer that's a much lower surface area. The potential solution provided by Zac seemed promising, but we didn't want to annotate every object so we removed that requirement and I posted this question https://stackoverflow.com/questions/60377758/moshi-factory-to-ignore-null-values-and-use-kotlin-default-value-when-deserializ and it all worked pretty smoothly until we noticed that with that adapter, our Numbers in Json became doubles (makes sense) but then our adapter down the line converted some cases to a string, and so we ended up with time stamps that looked like "1.5836742E12" instead of "1583674200000". So this takes me back to the original question... is there any chance to get a config/builder option to opt out of the "nulls will override default value" behavior?