Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Foso/Ktorfit
Browse files Browse the repository at this point in the history
  • Loading branch information
Foso committed Aug 31, 2022
2 parents ac4c6ea + 7c445d5 commit 02496aa
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build and test with Gradle
Expand Down
33 changes: 23 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
1.0.0-beta12 (Not released)
========================================
**Breaking Changes: **
## Breaking Changes:
wrapResponse from SuspendResponseConverter got renamed to wrapSuspendResponse. This add the possibility to have ResponseConverter and SuspendResponseConverter implemented in the same class.

**Changes: **
## Changes:
- throw compiler time error when you use @Path without the corresponding value inside the relative url path
- every generated implementation class of an interface that Ktorfit generates will now contain a "create" ext function that can be used instead of the generic create() function
e.g. Let's say you have a interface GithubService

'''kotlin
```kotlin
val kttorfit = ktorfit {
baseUrl("http://example.com/")
}.create<GithubService>()
'''

```
or this

'''kotlin
```kotlin
val kttorfit = ktorfit {
baseUrl("http://example.com/")
}.createGithubService()
'''
```

By default, IntelliJ/Android Studio can't find the generated code, you need to add the KSP generated folder to the sourcesets
like this:

```kotlin
kotlin.srcDir("build/generated/ksp/jvm/jvmMain/")
```


1.0.0-beta11 (21-08-2022)
========================================
Expand All @@ -42,30 +44,41 @@ kotlin.srcDir("build/generated/ksp/jvm/jvmMain/")
- @PATCH, @POST, @PUT now have a default value #22
- Ktorfit now uses a builder pattern for setup
e.g. change this:
Ktorfit("https://example.com/", HttpClient {})
```kotlin
Ktorfit("https://example.com/", HttpClient {})
```


to this:

```kotlin
Ktorfit.Builder()
.baseUrl("https://example.com/")
.httpClient(HttpClient {})
.build()
```

-
**Breaking Changes: **
## Breaking Changes:
@Headers now requires a vararg of String instead of an Array
e.g. you need to change from:

```kotlin
@Headers(
["Authorization: token ghp_abcdefgh",
"Content-Type: application/json"]
)
```

to this:

to this:
```kotlin
@Headers(
"Authorization: token ghp_abcdefgh",
"Content-Type: application/json"
)
```


1.0.0-beta09
========================================
Expand Down
2 changes: 1 addition & 1 deletion sandbox/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ kotlin {
dependencies {
implementation("io.ktor:ktor-client-core-jvm:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-rx3:1.6.4")
implementation("io.reactivex.rxjava3:rxjava:3.1.3")
implementation("io.reactivex.rxjava3:rxjava:3.1.5")
implementation("io.ktor:ktor-client-gson:$ktorVersion")
implementation("io.ktor:ktor-client-logging:$ktorVersion")

Expand Down

0 comments on commit 02496aa

Please sign in to comment.