ansman/kotshi

v2.9.0: Excess code generated in adapters (Kapt)

daviddenton opened this issue ยท 4 comments

This extra code causes compiler warnings. Was fine in 2.8.0 ๐Ÿ˜„

@OptIn(InternalKotshiApi::class)
internal object KotshiGitHubJsonAdapterFactory : GitHubJsonAdapterFactory {
  public override fun create(
    type: Type,
    annotations: Set<Annotation>,
    moshi: Moshi,
  ): JsonAdapter<*>? {

    val rawType = Types.getRawType(type)
    when {
    }

    if (annotations.isNotEmpty()) return null
     return when (Types.getRawType(type)) {
      Account::class.java ->
          KotshiAccountJsonAdapter(
            moshi = moshi
          )
...

Yeah I saw that and it was fixed in 2.10.0-alpha01 but I'll backport it to a patch release.

Amazing! TYSM :)

Just released 2.9.1 which fixes this. It might take a few hours for it to be available on Maven Central though.

Thanks!

Yes - I've had the pleasure of maven central when releasing http4k today.

We use a curl purge script to clear out the maven repo caches - which can help to speed things up.