Hi, i want to make use of the type-safe requests p...
# ktor
m
Hi, i want to make use of the type-safe requests plugin. One of the APIs i want to call has a parameter called
updated_after
. is it possible to declare it in the API describing class like
updatedAfter
and maybe add an annotation so the correct name is used on request?
a
You can add the
SerialName
annotation to keep the camel-cased property name and the snake-cased parameter name:
Copy code
@Resource("/path")
class MyClass(@SerialName("updated_after") val updatedAfter: String)
m
oh that's cool. thank you very much :)