Merge pull request #963 from jzbrooks/kotlin-enum-values

Keep synthesized values() for EnumJsonAdapter
This commit is contained in:
Zac Sweers
2019-10-26 15:05:17 -04:00
committed by GitHub

View File

@@ -8,9 +8,11 @@
-keep @com.squareup.moshi.JsonQualifier interface *
# Enum field names are used by the integrated EnumJsonAdapter.
# values() is synthesized by the Kotlin compiler and is used by EnumJsonAdapter indirectly
# Annotate enums with @JsonClass(generateAdapter = false) to use them with Moshi.
-keepclassmembers @com.squareup.moshi.JsonClass class * extends java.lang.Enum {
<fields>;
**[] values();
}
# The name of @JsonClass types is used to look up the generated adapter.