https://kotlinlang.org logo
#ktor
Title
# ktor
s

Santosh Astagi

01/30/2019, 7:32 PM
I get a list back from API call, so I have a kotlinxSerializer where I am registering two lists, as val kotlinxSerializer = KotlinxSerializer() kotlinxSerializer.register(FirstList.serializer().list) kotlinxSerializer.register(SecondList.serializer().list) However, when I make the call, only the last registered serializer is used. How can I register multiple lists to the serializer?
e

e5l

01/31/2019, 10:45 AM
Hi @Santosh Astagi, you could try
registerList
method 🙂
s

Santosh Astagi

01/31/2019, 4:42 PM
I tried, does it work for you, how do I register multiple with a single command. I could not.
e

e5l

02/01/2019, 7:02 AM
You could call
registerList
twice. Could you provide the code sample?
s

Santosh Astagi

02/22/2019, 3:10 AM
registerList(NameOfClass.serializer().list())
Sorry for late response.
e

e5l

02/22/2019, 7:10 PM
No problem. Could you try
registerList(NameOfClass.serializer())
instead?
s

Santosh Astagi

02/22/2019, 8:37 PM
Tried, didn't work.
Have you tried if it works for you, we are still seeing only on get registered. For better reference, here is a bug I filed with ktor:
4 Views