Michael Kotlikov
02/19/2018, 2:26 AMGsonBuilder
and not only configure it in the gson
block:
install(ContentNegotiation) (
gson {
setDateFormat(DateFormat.LONG)
}
}
like this:
install(ContentNegotiation) (
gson(existingGsonBuilder)
}
orangy
gson
function (github.com/ktorio/ktor/blob/master/ktor-features/ktor-gson/src/io/ktor/gson/GsonSupport.kt#L85), you can see that it is very easy to use existingGsonBuilder
.orangy
register(ContentType.Application.Json, GsonConverter(existingGsonBuilder.create()))
Michael Kotlikov
02/19/2018, 6:33 AM