diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index dccc8fd8a..fd26b1699 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -24,6 +24,8 @@ See https://foso.github.io/Ktorfit/generation/#nodelegation OptIn annotations on interfaces and functions will now be propagated to the generated classes. +- Fixed documentation for converters to match the current version. + # [2.1.0]() * Supported Kotlin version: 2.0.0; 2.0.10; 2.0.20, 2.1.0-Beta1; 2.0.21-RC, 2.0.21 diff --git a/docs/converters/example1.md b/docs/converters/example1.md index 30ed65abf..f262eb57b 100644 --- a/docs/converters/example1.md +++ b/docs/converters/example1.md @@ -72,22 +72,22 @@ Next we create the SuspendResponseConverter: ```kotlin if (typeData.typeInfo.type == User::class) { return object : Converter.SuspendResponseConverter { - override suspend fun convert(response: HttpResponse): Any { + override suspend fun convert(result: KtorfitResult): Any { ... } } } ``` -Inside of **convert** we get the HttpResponse and we want to return a User object. +Inside of **convert** we get the KtorfitResult and we want to return a User object. Now we could do the following: When we know that this converter will always be used for a API that wraps the User inside an Envelope class, we can directly transform the body to an envelope object and just return the user object. ```kotlin -override suspend fun convert(response: HttpResponse): Any { - val envelope = response.body() +override suspend fun convert(result: KtorfitResult): Any { + val envelope = result.response.body() return envelope.user } ``` @@ -95,9 +95,9 @@ override suspend fun convert(response: HttpResponse): Any { or we can create a TypeData of Envelope and use **nextSuspendResponseConverter()** to look up the next converter that can convert the response ```kotlin - override suspend fun convert(response: HttpResponse): Any { + override suspend fun convert(result: KtorfitResult): Any { val typeData = TypeData.createTypeData("com.example.model.Envelope", typeInfo()) - val envelope = ktorfit.nextSuspendResponseConverter(null, typeData)?.convert(response) as? Envelope + val envelope = ktorfit.nextSuspendResponseConverter(null, typeData)?.convert(result) as? Envelope return envelope.user } ``` diff --git a/example/AndroidOnlyExample/app/build.gradle.kts b/example/AndroidOnlyExample/app/build.gradle.kts index 4f7c2b1e9..37d4e5bd8 100644 --- a/example/AndroidOnlyExample/app/build.gradle.kts +++ b/example/AndroidOnlyExample/app/build.gradle.kts @@ -54,7 +54,7 @@ tasks.withType().configureEach val ktorfit = "2.0.0" val ktor = "2.3.11" -val compose_ui_version = "1.7.3" +val compose_ui_version = "1.7.4" dependencies { implementation("de.jensklingenberg.ktorfit:ktorfit-lib:$ktorfit") implementation("io.ktor:ktor-client-serialization:$ktor") @@ -65,11 +65,11 @@ dependencies { implementation("de.jensklingenberg.ktorfit:ktorfit-converters-flow:$ktorfit") - implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.4") - implementation("androidx.activity:activity-compose:1.9.2") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.6") + implementation("androidx.activity:activity-compose:1.9.3") implementation("androidx.compose.ui:ui:$compose_ui_version") implementation("androidx.compose.ui:ui-tooling-preview:$compose_ui_version") - implementation("androidx.compose.material:material:1.6.7") + implementation("androidx.compose.material:material:1.7.4") debugImplementation("androidx.compose.ui:ui-tooling:$compose_ui_version") debugImplementation("androidx.compose.ui:ui-test-manifest:$compose_ui_version") testImplementation("junit:junit:4.13.2") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index dfd74bae7..73aa9b7ab 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -69,7 +69,7 @@ ktor-client-serialization = { module = "io.ktor:ktor-client-serialization", vers ktor-serialization-gson = { module = "io.ktor:ktor-serialization-gson", version.ref = "ktorVersion" } ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktorVersion" } -licensee-gradle-plugin = "app.cash.licensee:licensee-gradle-plugin:1.11.0" +licensee-gradle-plugin = "app.cash.licensee:licensee-gradle-plugin:1.12.0" logbackClassic = "ch.qos.logback:logback-classic:1.5.6" mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version.ref = "mockito-kotlin" } mockk = { module = "io.mockk:mockk", version.ref = "mockk" } diff --git a/renovate.json5 b/renovate.json5 index a2c22557c..c06e93d4d 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -1,13 +1,16 @@ { - "extends": ["config:base"], - "schedule": [ - "every weekend" + extends: [ + 'config:best-practices', ], - "packageRules": [ + schedule: [ + 'every weekend', + ], + packageRules: [ { - "groupName": "Ktor Client", - "matchPackagePatterns": ["^io\\.ktor:ktor-client(-[^:]+)?$"], - - } - ] + groupName: 'Ktor Client', + matchPackageNames: [ + '/^io\\.ktor:ktor-client(-[^:]+)?$/', + ], + }, + ], }