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

Ovsyannikov Alexey

06/03/2022, 10:47 AM
Hello everybody 🙂 is tehre in ktor opportunity to automatically convert data types for
setBody
? I am using list and it throw an error with
Exception in thread "main" kotlin.reflect.jvm.internal.KotlinReflectionInternalError: Function 'create$lambda-0' (JVM signature: create$lambda-0(Lio/ktor/client/request/HttpRequestBuilder;Ldev/inmo/micro_utils/repos/ktor/client/crud/KtorWriteStandardCrudRepoClient;Ljava/util/List;)V) not resolved in class dev.inmo.micro_utils.repos.ktor.client.crud.KtorWriteStandardCrudRepoClient: no members found
. I am using content negotiation and set up application json content type
a

Aleksei Tirman [JB]

06/03/2022, 11:30 AM
To what types do you want to convert data types? Could you please share your code?
o

Ovsyannikov Alexey

06/03/2022, 11:31 AM
I found that in case I am using the
setBody
fun inside of fun with reified parameter is works correctly
p

Paul Woitaschek

06/03/2022, 5:59 PM
I don't like that API at all as it isn't compile time safe. We have extensions that take the object as well as an serializer.
1
h

hfhbd

06/03/2022, 9:36 PM
We too. It prevents (network) api changes.
2 Views