It would be great if I could pass in an existing `...
# ktor
m
It would be great if I could pass in an existing
GsonBuilder
and not only configure it in the
gson
block:
Copy code
install(ContentNegotiation) (
  gson {
    setDateFormat(DateFormat.LONG)
  }
}
like this:
Copy code
install(ContentNegotiation) (
  gson(existingGsonBuilder)
}
o
If you go to definition of
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
.
Basically, it is
Copy code
register(ContentType.Application.Json, GsonConverter(existingGsonBuilder.create()))
m
thanks!