You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @esafirm , thank you. I understand your concerns.
Yes, it was done this was way to mimic Retrofit.
It`s not really documented, but Ktorfit also generates an extension function on Ktorfit for every generated interface implementation.
So you can already do
val api = ktorfit.createExampleApi()
The only issue with that is, that you can use this function only in platform specific modules, not in a common module. This is because KSP only generates code to the platform specific modules. If you just want to use it in Android projects, it should work this way and you don`t need the gradle/compiler plugin
@esafirm With Ktorfit 2.0.0 I found a way to make the extension functions usable from commonMain. The compiler plugin is for now still part of the project, but when you use the extension functions, the compiler plugin will not be active.
Hi @Foso, great library! I was thinking of creating something like this but luckily found this first.
My concern with this is that
create()
can throw a runtime error if the compiler plugin is not appliedI 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 thecreation
to the impl insteadLet me know what you think.
Cheers!
The text was updated successfully, but these errors were encountered: