diff --git a/core/data/src/commonMain/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJson.kt b/core/data/src/commonMain/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJson.kt index 0773557e3..dfddd3879 100644 --- a/core/data/src/commonMain/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJson.kt +++ b/core/data/src/commonMain/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJson.kt @@ -11,7 +11,10 @@ internal data class ProfileCardJson( val occupation: String, val link: String, val image: String, - @Deprecated("Use cardType instead", replaceWith = ReplaceWith("cardType")) + @Deprecated( + "Let's use cardType, but keep it for compatibility.", + replaceWith = ReplaceWith("cardType") + ) val theme: String? = null, @SerialName("card_type") val cardType: String? = null, @@ -22,7 +25,7 @@ internal fun ProfileCardJson.toModel() = ProfileCard.Exists( occupation = occupation, link = link, image = image, - cardType = checkNotNull(cardType ?: theme).toProfileCardType(), + cardType = checkNotNull(cardType ?: cardType).toProfileCardType(), ) internal fun String.toProfileCardType() = ProfileCardType.valueOf(this) diff --git a/core/data/src/commonTest/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJsonTest.kt b/core/data/src/commonTest/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJsonTest.kt index acde3bee6..b83a0c924 100644 --- a/core/data/src/commonTest/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJsonTest.kt +++ b/core/data/src/commonTest/kotlin/io/github/droidkaigi/confsched/data/profilecard/ProfileCardJsonTest.kt @@ -24,7 +24,7 @@ class ProfileCardJsonTest { assertEquals("test occupation", profileCardJson.occupation) assertEquals("https://github.com/DroidKaigi/conference-app-2024", profileCardJson.link) assertEquals("BASE64_ENCODED_SAMPLE_IMAGE_STRING", profileCardJson.image) - assertEquals("Iguana", profileCardJson.theme) + assertEquals("Iguana", profileCardJson.cardType) assertNull(profileCardJson.cardType) } @@ -44,7 +44,7 @@ class ProfileCardJsonTest { assertEquals("test occupation", profileCardJson.occupation) assertEquals("https://github.com/DroidKaigi/conference-app-2024", profileCardJson.link) assertEquals("BASE64_ENCODED_SAMPLE_IMAGE_STRING", profileCardJson.image) - assertNull(profileCardJson.theme) + assertNull(profileCardJson.cardType) assertEquals("Iguana", profileCardJson.cardType) }