Not finding @com.squareup.moshi.Json <fields>; rule in official moshi proguard file. Am I missing something?

32 views Asked by At

Given a simple data class

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
data class User(
    @field:Json(name = "name")
    val name: String,
    @field:Json(name = "age")
    val age: Int
)

I expect there should be a proguard rule which looks something like

# https://r8.googlesource.com/r8/+/refs/heads/master/compatibility-faq.md
-keepclassmembers,allowobfuscation class * {
    @com.squareup.moshi.Json <fields>;
}

But, I do not find anything similar in https://github.com/square/moshi/blob/master/moshi/src/main/resources/META-INF/proguard/moshi.pro

Am I missing something? Or, the above rule is not written correctly?

0

There are 0 answers