Prefix descriptor names of custom serializers

This commit is contained in:
Niels van Velzen 2024-08-29 17:15:01 +02:00 committed by Niels van Velzen
parent aee65c0d31
commit c8291f63a9
2 changed files with 2 additions and 2 deletions

View File

@ -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()

View File

@ -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()