Skip to content

Commit

Permalink
Fix deserialization of DiscordApplication (#871)
Browse files Browse the repository at this point in the history
Discord started sending null values for
role_connections_verification_url, although it is only documented as
optional.

Fixes #870
  • Loading branch information
lukellmann authored Sep 17, 2023
1 parent 4aa9701 commit 1b95322
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions common/src/commonMain/kotlin/entity/DiscordApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public sealed interface BaseDiscordApplication {
public val tags: Optional<List<String>>
public val installParams: Optional<InstallParams>
public val customInstallUrl: Optional<String>
public val roleConnectionsVerificationUrl: Optional<String>
public val roleConnectionsVerificationUrl: Optional<String?>
}

/**
Expand Down Expand Up @@ -127,7 +127,7 @@ public data class DiscordApplication(
@SerialName("custom_install_url")
override val customInstallUrl: Optional<String> = Optional.Missing(),
@SerialName("role_connections_verification_url")
override val roleConnectionsVerificationUrl: Optional<String> = Optional.Missing(),
override val roleConnectionsVerificationUrl: Optional<String?> = Optional.Missing(),
) : BaseDiscordApplication

/**
Expand Down Expand Up @@ -164,7 +164,7 @@ public data class DiscordPartialApplication(
@SerialName("custom_install_url")
override val customInstallUrl: Optional<String> = Optional.Missing(),
@SerialName("role_connections_verification_url")
override val roleConnectionsVerificationUrl: Optional<String> = Optional.Missing(),
override val roleConnectionsVerificationUrl: Optional<String?> = Optional.Missing(),
) : BaseDiscordApplication

@Deprecated("Binary compatibility. Keep for some releases.", level = DeprecationLevel.HIDDEN)
Expand Down
6 changes: 3 additions & 3 deletions core/src/commonMain/kotlin/cache/data/ApplicationData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public sealed interface BaseApplicationData {
public val tags: Optional<List<String>>
public val installParams: Optional<InstallParams>
public val customInstallUrl: Optional<String>
public val roleConnectionsVerificationUrl: Optional<String>
public val roleConnectionsVerificationUrl: Optional<String?>
}

@Serializable
Expand All @@ -49,7 +49,7 @@ public data class ApplicationData(
override val tags: Optional<List<String>> = Optional.Missing(),
override val installParams: Optional<InstallParams> = Optional.Missing(),
override val customInstallUrl: Optional<String> = Optional.Missing(),
override val roleConnectionsVerificationUrl: Optional<String> = Optional.Missing(),
override val roleConnectionsVerificationUrl: Optional<String?> = Optional.Missing(),
) : BaseApplicationData {
public companion object {

Expand Down Expand Up @@ -101,7 +101,7 @@ public data class PartialApplicationData(
override val tags: Optional<List<String>> = Optional.Missing(),
override val installParams: Optional<InstallParams> = Optional.Missing(),
override val customInstallUrl: Optional<String> = Optional.Missing(),
override val roleConnectionsVerificationUrl: Optional<String> = Optional.Missing(),
override val roleConnectionsVerificationUrl: Optional<String?> = Optional.Missing(),
) : BaseApplicationData {
public companion object {

Expand Down

0 comments on commit 1b95322

Please sign in to comment.