diff --git a/core/client/src/main/kotlin/org/http4k/connect/ConnectJsonAdapterFactory.kt b/core/client/src/main/kotlin/org/http4k/connect/ConnectJsonAdapterFactory.kt index 1a72c1e3d..4bb1a8640 100644 --- a/core/client/src/main/kotlin/org/http4k/connect/ConnectJsonAdapterFactory.kt +++ b/core/client/src/main/kotlin/org/http4k/connect/ConnectJsonAdapterFactory.kt @@ -8,10 +8,8 @@ import java.lang.reflect.Type abstract class ConnectJsonAdapterFactory(vararg typesToAdapters: Pair JsonAdapter<*>>) : JsonAdapter.Factory { private val mappings = typesToAdapters.toMap() - override fun create(type: Type, annotations: Set, moshi: Moshi) = when { - annotations.isNotEmpty() -> null - else -> mappings[Types.getRawType(type).typeName]?.let { it(moshi) } - } + override fun create(type: Type, annotations: Set, moshi: Moshi) = + mappings[Types.getRawType(type).typeName]?.let { it(moshi) } } inline fun , reified K> adapter(noinline fn: (Moshi) -> T) = K::class.java.name to fn