HTTP client generator / KSP plugin for Kotlin Multiplatform (Android, iOS, Js, Jvm, Native) using KSP and Ktor clients inspired by Retrofit https://foso.github.io/Ktorfit
APACHE-2.0 License
Bot releases are hidden (Show)
Published by Foso 10 months ago
Published by Foso 11 months ago
Compatible with KSP 1.0.15 and Kotlin 1.9.21
Published by Foso 11 months ago
Published by Foso 12 months ago
Compatible with KSP 1.0.13 and Kotlin 1.9.10/1.9.20-RC
When you are still using the Ktorfit Gradle plugin in version 1.0.0, please also update that to 1.9.1
Published by Foso about 1 year ago
Compatible with KSP 1.0.13 and Kotlin 1.9.10/1.9.20-Beta2
convert
function in the SuspendResponseConverter
interface! When you still use the deprecated converters because there are use cases which you can't do with the converter factories, please write a GitHub Issue.
The deprecated converters will be removed in one of the upcoming versions
Published by Foso about 1 year ago
From now on with every Ktorfit release there will also be a Gradle plugin with the same version.
That means that drop you can drop the Gradle extension block where you previously set the version number and just bump the number of the Gradle plugin. https://foso.github.io/Ktorfit/installation/
plugins {
id("de.jensklingenberg.ktorfit") version "1.7.0"
}
Published by Foso about 1 year ago
Published by Foso about 1 year ago
🎉 Ktorfit 1.5.0 has been released!
Published by Foso about 1 year ago
Published by Foso over 1 year ago
#372 Crash with Xiaomi on create Ktorfit.Builder by @princeparadoxes
Published by Foso over 1 year ago
#323 Code generation issue for @Multipart / @FormUrlEncoded by @Ph1ll1pp
Published by Foso over 1 year ago
#236 Parsing error for list/array
Published by Foso over 1 year ago
e.g.
interface ExampleApi{
suspend fun getUser(): Response<User>
}
val user = userKtorfit.create<ExampleApi>().getUser()
if(user.isSuccessful){
user.body()
}else{
user.errorBody()
}
Ktorfit is now using converters factories to apply the converters, similar to Retrofit
see more here https://foso.github.io/Ktorfit/converters/converters/
TypeData now has a field "typeInfo" can be used to convert the Ktor HttpResponse body to the wanted type
CallConverterFactory for replacement of CallResponseConverter
FlowConverterFactory for replacement of FlowResponseConverter
Added support for targets:
macosArm64, tvosArm64, tvosX64, tvosSimulatorArm64, watchosSimulatorArm64 #315
Published by Foso over 1 year ago
Optimized generated code, the generated code that is used for a request will
now directly set the Ktor code instead of delegating it to a Ktorfit class. This will
make the code easier to understand.
KSP version 1.0.11 is now needed
[Bug]: IllegalArgumentException with Custom Http Annotation #274
KSP version to 1.0.11
Published by Foso over 1 year ago
Published by Foso over 1 year ago
From now on there are two versions of the ktorfit-lib.
"de.jensklingenberg.ktorfit:ktorfit-lib"
will stay like before and add the platform Ktor client dependencies for the clients.
"de.jensklingenberg.ktorfit:ktorfit-lib-light"
this will only add the Ktor client core dependency and not the platform dependencies for the clients.
This will give you more control over the used clients, but you have to add them yourself. https://ktor.io/docs/http-client-engines.html
Everything else is the same as "ktorfit-lib"
Kotlin version 1.8.20 is now needed
KSP version 1.8.20-1.0.10 is now needed
Kotlin to 1.8.20
KSP version to 1.8.20-1.0.10
Published by Foso over 1 year ago
From now on there are two versions of the ktorfit-lib :
de.jensklingenberg.ktorfit:ktorfit-lib
will stay like before and already includes the platform client dependencies for the clients.
de.jensklingenberg.ktorfit:ktorfit-lib-light
this includes only the client core dependency and not the platform dependencies for the clients. This will give you more control over the used clients, but you have to add them yourself. https://ktor.io/docs/http-client-engines.html
Everything else is the same as "ktorfit-lib"
[Bug]: Post request body serialization doesn't work #202
Full Changelog: https://github.com/Foso/Ktorfit/compare/v1.0.0...v1.0.1