handlebars.kotlin-client.infrastructure.Serializer.kt.mustache Maven / Gradle / Ivy
package {{packageName}}.infrastructure
import com.squareup.moshi.Moshi
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import java.util.Date
object Serializer {
@JvmStatic
val moshi: Moshi = Moshi.Builder()
.add(KotlinJsonAdapterFactory())
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
.add(LocalDateTimeAdapter())
.add(LocalDateAdapter())
.build()
}