Skip to content

Commit

Permalink
Set Snapshot version
Browse files Browse the repository at this point in the history
  • Loading branch information
Foso committed Apr 27, 2024
1 parent 56adf91 commit d2b3eaa
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 29 deletions.
7 changes: 7 additions & 0 deletions docs/converters/converters.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@ implementation("de.jensklingenberg.ktorfit:ktorfit-converters-call:$ktorfit")
Add this dependency:
```kotlin
implementation("de.jensklingenberg.ktorfit:ktorfit-converters-flow:$ktorfit")
```

* ResponseConverterFactory

Add this dependency:
```kotlin
implementation("de.jensklingenberg.ktorfit:ktorfit-converters-response:$ktorfit")
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import com.google.devtools.ksp.symbol.KSFunctionDeclaration
import com.squareup.kotlinpoet.FunSpec
import com.squareup.kotlinpoet.KModifier
import com.squareup.kotlinpoet.ParameterSpec
import com.squareup.kotlinpoet.ParameterizedTypeName
import com.squareup.kotlinpoet.ksp.toTypeName
import de.jensklingenberg.ktorfit.model.annotations.*
import de.jensklingenberg.ktorfit.model.annotations.ParameterAnnotation.*
import de.jensklingenberg.ktorfit.reqBuilderExtension.getReqBuilderExtensionText
import de.jensklingenberg.ktorfit.typeData.addRequestConverterText
import de.jensklingenberg.ktorfit.reqBuilderExtension.addRequestConverterText
import de.jensklingenberg.ktorfit.utils.*

data class FunctionData(
Expand Down Expand Up @@ -46,11 +45,11 @@ data class FunctionData(
.addStatement(
"val ${typeDataClass.objectName} = ${typeDataClass.name}.createTypeData("
)
.addStatement("typeInfo = typeInfo<%L>(),", this.returnType.parameterType.toTypeName())
.addStatement(
"qualifiedTypename = \"%L\",",
"qualifiedTypename = \"%L\")",
this.returnType.parameterType.toTypeName().toString().removeWhiteSpaces()
)
.addStatement("typeInfo = typeInfo<%L>())\n", this.returnType.parameterType.toTypeName())
.addStatement(
"return %L.%L<${returnTypeName}>(%L,${extDataClass.objectName})%L",
converterHelper.objectName,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.jensklingenberg.ktorfit.typeData
package de.jensklingenberg.ktorfit.reqBuilderExtension

import com.squareup.kotlinpoet.FunSpec
import com.squareup.kotlinpoet.ksp.toClassName
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import de.jensklingenberg.ktorfit.model.ParameterData
import de.jensklingenberg.ktorfit.model.ReturnTypeData
import de.jensklingenberg.ktorfit.model.annotations.ParameterAnnotation
import de.jensklingenberg.ktorfit.model.annotations.ParameterAnnotation.RequestType
import de.jensklingenberg.ktorfit.typeData.addRequestConverterText
import de.jensklingenberg.ktorfit.reqBuilderExtension.addRequestConverterText
import org.junit.Assert.assertEquals
import org.junit.Test
import org.mockito.kotlin.mock
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ import kotlin.reflect.KClass
public data class TypeData(
public val qualifiedName: String,
public val typeArgs: List<TypeData> = emptyList(),
public val isNullable: Boolean = qualifiedName.endsWith("?"),
public val typeInfo: TypeInfo,
public val isNullable: Boolean = typeInfo.kotlinType?.isMarkedNullable ?: false,
) {
public companion object {
public fun createTypeData(qualifiedTypename: String, typeInfo: TypeInfo): TypeData {

val typeArgument = qualifiedTypename.substringAfter("<").substringBeforeLast(">")
val split = typeArgument.split(",")
val args = typeInfo.kotlinType?.arguments?.mapIndexed { index, kTypeProjection ->
Expand Down

0 comments on commit d2b3eaa

Please sign in to comment.