https://kotlinlang.org logo
Title
a

Alen Mujezinovic

01/12/2022, 12:16 PM
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

dave

01/12/2022, 1:44 PM
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

pabl0rg

01/21/2022, 11:21 AM
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

Alen Mujezinovic

01/26/2022, 9:23 AM
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