Ktorfit
Ktorfit copied to clipboard
Compile-time safe Ktorfit
Hi @Foso, great library! I was thinking of creating something like this but luckily found this first.
My concern with this is that
- There's a lack of a compile-time safe in the library,
create()
can throw a runtime error if the compiler plugin is not applied - The needs to add an extra Gradle plugin to create the first condition
I assume you chose this design to mimic what Retrofit
have, but maybe we can make this better by not doing so?
What I have in mind is to have a generation like Dagger
and move the creation
to the impl instead
interface ExampleApi { ... }
// Instead of _ExampleApiImpl
val api = KtorfitExampleApi.create(ktorfit)
Let me know what you think.
Cheers!