Skip to content

Commit

Permalink
relase: 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Foso committed Jun 3, 2023
1 parent d608141 commit 8777dcf
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 14 deletions.
10 changes: 10 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added
### Changed
### Deprecated
### Removed
### Fixed
### Security

1.4.1 - 2023-06-03
========================================

### Added

### Changed
Expand Down
2 changes: 1 addition & 1 deletion example/AndroidOnlyExample/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id ("de.jensklingenberg.ktorfit") version "1.0.0"

}
val ktorfit = "1.4.0"
val ktorfit = "1.4.1"

configure<de.jensklingenberg.ktorfit.gradle.KtorfitGradleConfiguration> {
version = ktorfit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import kotlinx.coroutines.launch
import kotlinx.serialization.json.Json

val ktorfit = ktorfit {
baseUrl("https://swapi.dev/api/")
baseUrl(StarWarsApi.baseUrl)
httpClient(HttpClient {
install(ContentNegotiation) {
json(Json { isLenient = true; ignoreUnknownKeys = true })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import kotlinx.coroutines.flow.Flow

interface StarWarsApi {

companion object {
const val baseUrl = "https://swapi.dev/api/"
}

@GET("people/{id}/")
suspend fun getPerson(@Path("id") personId: Int): Person

Expand Down
2 changes: 1 addition & 1 deletion example/MultiplatformExample/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {

version = "1.0"
val ktorVersion = "2.3.1"
val ktorfitVersion = "1.4.0"
val ktorfitVersion = "1.4.1"

configure<de.jensklingenberg.ktorfit.gradle.KtorfitGradleConfiguration> {
version = ktorfitVersion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
package com.example.ktorfittest

import de.jensklingenberg.ktorfit.converter.builtin.CallConverterFactory
import de.jensklingenberg.ktorfit.converter.builtin.CallResponseConverter
import de.jensklingenberg.ktorfit.converter.builtin.FlowConverterFactory
import de.jensklingenberg.ktorfit.converter.builtin.FlowResponseConverter
import de.jensklingenberg.ktorfit.create
import de.jensklingenberg.ktorfit.ktorfit
import io.ktor.client.*
import io.ktor.client.plugins.contentnegotiation.*
import io.ktor.serialization.kotlinx.json.*
import io.ktor.client.HttpClient
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
import io.ktor.serialization.kotlinx.json.json
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import kotlinx.serialization.json.Json

val ktorfit = ktorfit {
baseUrl("https://swapi.dev/api/")
baseUrl(StarWarsApi.baseUrl)
httpClient(HttpClient {
install(ContentNegotiation) {
json(Json { isLenient = true; ignoreUnknownKeys = true })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import de.jensklingenberg.ktorfit.http.Query
import kotlinx.coroutines.flow.Flow

interface StarWarsApi {
companion object {
const val baseUrl = "https://swapi.dev/api/"
}

@GET("people/{id}/")
suspend fun getPersonByIdResponse(@Path("id") peopleId: Int): Person

Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ kctfork = "0.2.1"
kotlin = "1.8.21"
kotlinPoet = "1.14.2"
kspVersion = "1.8.21-1.0.11"
ktorfit = "1.4.0"
ktorfit-lib = "1.4.0"
ktorfit = "1.4.1"
ktorfit-lib = "1.4.1"
ktorVersion = "2.3.1"
dokkaVersion = "1.8.10"
gradleMavenPublishPlugin = "0.24.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ internal class KtorfitClient(private val ktorfit: Ktorfit) : Client {
*/
handleDeprecatedSuspendResponseConverters<ReturnType, RequestType>(requestData)?.let {
return it
} ?: DefaultSuspendResponseConverterFactory().suspendResponseConverter(returnTypeData, ktorfit)?.let {
} ?: DefaultSuspendResponseConverterFactory().suspendResponseConverter(returnTypeData, ktorfit).let {
val response = httpClient.request {
requestBuilder(requestData)
}
return it.convert(response) as ReturnType?
} ?: throw IllegalStateException("No SuspendResponseConverter found for " + returnTypeData.qualifiedName)
}

} catch (exception: Exception) {
val typeIsNullable = returnTypeData.isNullable
Expand Down

0 comments on commit 8777dcf

Please sign in to comment.