Ktor: Usage of kotlinx.serialization as ContentNegotiation in server

Created on 10 Dec 2018  Â·  4Comments  Â·  Source: ktorio/ktor

Hi Ktor team.

Maybe it’s not the best place to ask this but, I can’t figure out something..
Ktor/Kotlin have KotlinX extension and a serialization module in it, supporting native kotlin behavior like optional (default value). I’m talking about the Json serialization here, but I keep in mind that kotlinx is capable of much more.

Could d we implement a ContentNegotiation feature in Ktor server to benefit from this ‘official’ serializer ? It could be a better fit than relying on non kotlin alternative as Gson or community based like Ktor-Moshi.

What do you think about this feature ? And what could we do to see this feature implemented ?

enhancement

Most helpful comment

Has anything changed regarding this? I too would like to use kotlinx.serialization on my server as opposed to Gson.

All 4 comments

For now absence of type token compiler support is the blocker for server. On client side we have a trick to get a type token but it's relatively slow. It is acceptable for client but not for server side.

Ok, it's more clear now.
thanks

Has anything changed regarding this? I too would like to use kotlinx.serialization on my server as opposed to Gson.

Yeah guys, may be reopen this?

Was this page helpful?
0 / 5 - 0 ratings