Skip to content

Commit

Permalink
Prefix descriptor names of custom serializers
Browse files Browse the repository at this point in the history
(cherry picked from commit c8291f6)
  • Loading branch information
nielsvanvelzen committed Sep 8, 2024
1 parent 3818797 commit 5f61381
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import java.time.format.DateTimeParseException
public actual class DateTimeSerializer(
private val zoneId: ZoneId = ZoneId.systemDefault(),
) : KSerializer<DateTime> {
actual override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("LocalDateTime", PrimitiveKind.STRING)
actual override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("org.jellyfin.LocalDateTime", PrimitiveKind.STRING)

actual override fun deserialize(decoder: Decoder): DateTime = try {
ZonedDateTime.parse(decoder.decodeString()).withZoneSameInstant(zoneId).toLocalDateTime()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public actual fun String.toUUIDOrNull(): UUID? = try {
}

public actual class UUIDSerializer : KSerializer<UUID> {
actual override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("UUID", PrimitiveKind.STRING)
actual override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("org.jellyfin.UUID", PrimitiveKind.STRING)

actual override fun deserialize(decoder: Decoder): UUID {
return decoder.decodeString().toUUID()
Expand Down

0 comments on commit 5f61381

Please sign in to comment.