From 1b953226df94e401a55f24b01e695fd658257fa5 Mon Sep 17 00:00:00 2001 From: lukellmann <47486203+lukellmann@users.noreply.github.com> Date: Sun, 17 Sep 2023 02:49:14 +0200 Subject: [PATCH] Fix deserialization of DiscordApplication (#871) Discord started sending null values for role_connections_verification_url, although it is only documented as optional. Fixes #870 --- common/src/commonMain/kotlin/entity/DiscordApplication.kt | 6 +++--- core/src/commonMain/kotlin/cache/data/ApplicationData.kt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/src/commonMain/kotlin/entity/DiscordApplication.kt b/common/src/commonMain/kotlin/entity/DiscordApplication.kt index a4e5856fdcd..934fb29dad0 100644 --- a/common/src/commonMain/kotlin/entity/DiscordApplication.kt +++ b/common/src/commonMain/kotlin/entity/DiscordApplication.kt @@ -86,7 +86,7 @@ public sealed interface BaseDiscordApplication { public val tags: Optional> public val installParams: Optional public val customInstallUrl: Optional - public val roleConnectionsVerificationUrl: Optional + public val roleConnectionsVerificationUrl: Optional } /** @@ -127,7 +127,7 @@ public data class DiscordApplication( @SerialName("custom_install_url") override val customInstallUrl: Optional = Optional.Missing(), @SerialName("role_connections_verification_url") - override val roleConnectionsVerificationUrl: Optional = Optional.Missing(), + override val roleConnectionsVerificationUrl: Optional = Optional.Missing(), ) : BaseDiscordApplication /** @@ -164,7 +164,7 @@ public data class DiscordPartialApplication( @SerialName("custom_install_url") override val customInstallUrl: Optional = Optional.Missing(), @SerialName("role_connections_verification_url") - override val roleConnectionsVerificationUrl: Optional = Optional.Missing(), + override val roleConnectionsVerificationUrl: Optional = Optional.Missing(), ) : BaseDiscordApplication @Deprecated("Binary compatibility. Keep for some releases.", level = DeprecationLevel.HIDDEN) diff --git a/core/src/commonMain/kotlin/cache/data/ApplicationData.kt b/core/src/commonMain/kotlin/cache/data/ApplicationData.kt index d961b35be6d..8510247e18d 100644 --- a/core/src/commonMain/kotlin/cache/data/ApplicationData.kt +++ b/core/src/commonMain/kotlin/cache/data/ApplicationData.kt @@ -24,7 +24,7 @@ public sealed interface BaseApplicationData { public val tags: Optional> public val installParams: Optional public val customInstallUrl: Optional - public val roleConnectionsVerificationUrl: Optional + public val roleConnectionsVerificationUrl: Optional } @Serializable @@ -49,7 +49,7 @@ public data class ApplicationData( override val tags: Optional> = Optional.Missing(), override val installParams: Optional = Optional.Missing(), override val customInstallUrl: Optional = Optional.Missing(), - override val roleConnectionsVerificationUrl: Optional = Optional.Missing(), + override val roleConnectionsVerificationUrl: Optional = Optional.Missing(), ) : BaseApplicationData { public companion object { @@ -101,7 +101,7 @@ public data class PartialApplicationData( override val tags: Optional> = Optional.Missing(), override val installParams: Optional = Optional.Missing(), override val customInstallUrl: Optional = Optional.Missing(), - override val roleConnectionsVerificationUrl: Optional = Optional.Missing(), + override val roleConnectionsVerificationUrl: Optional = Optional.Missing(), ) : BaseApplicationData { public companion object {