Ktor annotated interfaces as in Retrofit

865 Views Asked by At

I was wondering if there is a way to annotate Ktor requests in a similar manner as in Retrofit (see example below), ie. as annotations on interface methods? Unfortunately, I couldn't find anything in the documentation regarding that.

Basically, this is what I would like to achieve:

@GET("event/{id}/entries?")
suspend fun getInitialEntries(
    @Path("id") id: Int,
    @Query("count") count: Int,
    @Query("debug") debug: Boolean) : LiveTicker
1

There are 1 best solutions below

0
On

Check out Ktorfit - it's a client with Retrofit-style API, backed by Ktor.