Hi folks. Quick question: Is there any support for...
# http4k
a
Hi folks. Quick question: Is there any support for using
kotlinx.serialization
with the
contract
module? The data classes in
contract
are not market with any annotations that the
kotlinx
lib needs. Would I have to create custom serialisers?
d
nope - there is no current support for it in the contracts module - only Jackson. TBH, although we support Kotlinx.serialization as a module I can't actually see any advantage of it over and above Jackson - the serialization just seems like such a hassle to setup.... so would be interested to know why you've selected it. Generally my next go-to combination would be Moshi + Kotshi generated adapters (but not with the contract module OFC 🙂 )
p
I can’t say why OP wants it, but to me the main benefit of kotlinx.serialization is that it works in Kotlin/JS. It would be great to generate client libraries for my APIs
a
I switched it out to use Jackson in the end. I used
kotlinx.serialization
mostly out of habit because I've built things using Kotlin/JS previously where it's all
kotlinx.serialization
. But Kotlin/JS is not a consideration currently