Ktorfit

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

Stars
1.3K

Bot releases are visible (Hide)

Ktorfit - 1.12.0 Latest Release

Published by Foso 9 months ago

1.12.0 - 2024-01-16

  • Compatible with KSP 1.0.16 and Kotlin 1.9.22
Ktorfit - 1.11.1

Published by Foso 10 months ago

1.11.1 - 2023-12-21

  • Fix compile errors #505 #496
Ktorfit - 1.11.0

Published by Foso 11 months ago

1.11.0 - 2023-12-06

Compatible with KSP 1.0.15 and Kotlin 1.9.21

Changed

  • KSP 1.0.15 required
  • Upgrade dependencies: Ktor 2.3.6
Ktorfit - 1.10.2

Published by Foso 11 months ago

1.10.2 - 2023-11-29

Fixed

  • fix compile errors because of missing import #490 #486
Ktorfit - 1.10.1

Published by Foso 11 months ago

1.10.1 - 2023-11-15

Fixed

  • Using @FieldMap generates uncompiled code due to missing import #479
Ktorfit - 1.10.0

Published by Foso 12 months ago

1.10.0 - 2023-11-06

Compatible with KSP 1.0.14 and Kotlin 1.9.20

Added

  • LinuxArm64 support #475

Changed

  • KSP 1.0.14 required
  • Optimized code generation
Ktorfit - 1.9.1

Published by Foso 12 months ago

1.9.1 - 2023-10-22

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

Added

Changed

  • The generated code will not produce warnings anymore
Ktorfit - 1.8.1

Published by Foso about 1 year ago

1.8.1 - 2023-10-09

Compatible with KSP 1.0.13 and Kotlin 1.9.10/1.9.20-Beta2

Changed

  • Allow nullable body type #424
  • Use @ Path parameter name as default value #426
  • Use @ Query parameter name as default value #428
  • Use @ Field parameter name as default value #430
  • You can now also get exceptions like NetworkException with SuspendResponseConverter.#389

Deprecated

! 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

Ktorfit - 1.7.0

Published by Foso about 1 year ago

1.7.0 - 2023-09-16

Gradle plugin

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"
}

Added

  • Added a compiler type checks if the type used for the create function is an interface

Changed

  • Upgrade dependencies: Ktor 2.3.4

Deprecated

Removed

Fixed

Security

Ktorfit - v1.6.0

Published by Foso about 1 year ago

1.6.0 - 2023-08-24

Changed

  • KSP version 1.9.10-1.0.13 is now required
  • Upgrade dependencies: Ktor 2.3.3
Ktorfit - v1.5.0

Published by Foso about 1 year ago

🎉 Ktorfit 1.5.0 has been released!

Added

Changed

  • KSP version 1.9.0-1.0.13 is now required

Deprecated

Removed

Fixed

Security

Ktorfit - v1.4.4

Published by Foso about 1 year ago

1.4.4 - 2023-07-26

Added

Changed

  • Upgrade dependencies: Ktor 2.3.2

Deprecated

Removed

Fixed

Security

Ktorfit - v1.4.3

Published by Foso over 1 year ago

1.4.3 - 2023-07-13

Added

Changed

Deprecated

Removed

Fixed

#372 Crash with Xiaomi on create Ktorfit.Builder by @princeparadoxes

Ktorfit - v1.4.2

Published by Foso over 1 year ago

1.4.2 - 2023-06-25

Added

Changed

Deprecated

Removed

Fixed

#323 Code generation issue for @Multipart / @FormUrlEncoded by @Ph1ll1pp

Ktorfit - v1.4.1

Published by Foso over 1 year ago

1.4.1 - 2023-06-03

Added

Changed

  • Upgrade dependencies: Ktor 2.3.1

Deprecated

Removed

Fixed

#236 Parsing error for list/array

Security

Ktorfit - v1.4.0

Published by Foso over 1 year ago

1.4.0 - 2023-05-27

Added

  • #85 Added a Response class that can be used as a wrapper around the API Response, the converter for it is automatically applied. thx to @vovahost, @DATL4G

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

Changed

  • Upgrade dependencies: Kotlin 1.8.21

Deprecated

  • ResponseConverter, use Converter.ResponseConverter instead
  • SuspendResponseConverter, use Converter.SuspendResponseConverter instead
  • RequestConverter, use Converter.RequestParameterConverter instead
  • See also: https://foso.github.io/Ktorfit/converters/migration/

Removed

Fixed

Security

Ktorfit - v1.3.0

Published by Foso over 1 year ago

1.3.0 - 2023-05-14

Added

Changed

  • 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

Deprecated

Removed

Fixed

[Bug]: IllegalArgumentException with Custom Http Annotation #274

Security

Bumped

KSP version to 1.0.11

Ktorfit - v1.2.0

Published by Foso over 1 year ago

1.2.0 - 2023-05-05

Added

Changed

Deprecated

Removed

Fixed

Security

Bumped

  • Now using on Ktor 2.3.0
Ktorfit - v1.1.0

Published by Foso over 1 year ago

1.1.0 - 2023-04-15

Added

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"

Changed

Kotlin version 1.8.20 is now needed
KSP version 1.8.20-1.0.10 is now needed

Deprecated

Removed

Fixed

Security

Bumped

Kotlin to 1.8.20
KSP version to 1.8.20-1.0.10

Ktorfit - v1.0.1

Published by Foso over 1 year ago

1.0.1 - 2023-03-20

Added

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"

Changed

Deprecated

Removed

Fixed

[Bug]: Post request body serialization doesn't work #202

Security

Bumped

New Contributors

Full Changelog: https://github.com/Foso/Ktorfit/compare/v1.0.0...v1.0.1

Package Rankings
Top 22.37% on Repo1.maven.org
Badges
Extracted from project README
Maven PRs Welcome License Platforms GitHub stars GitHub forks Twitter Follow Maven Central Maven Central Maven Central Maven Central Maven Central Maven Central Maven Central Maven Central Maven Central Maven Central Maven Central Maven Central Maven Central