Skip to content

Commit 97a9321

Browse files
committed
feat: enhance UUID deserialization to handle both standard and alternative formats
1 parent fcb049b commit 97a9321

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
77
javaVersion=21
88
mcVersion=1.21.10
99
group=dev.slne.surf
10-
version=1.21.10-2.42.0
10+
version=1.21.10-2.42.1
1111
relocationPrefix=dev.slne.surf.surfapi.libs
1212
snapshot=false

surf-api-core/surf-api-core-api/src/main/kotlin/dev/slne/surf/surfapi/core/api/serializer/java/uuid/JavaUUIDStringSerializer.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ object JavaUUIDStringSerializer : KSerializer<UUID> {
1818
}
1919

2020
override fun deserialize(decoder: Decoder): UUID {
21-
return fromString(decoder.decodeString())
21+
val input = decoder.decodeString()
22+
if (input.length == 36) {
23+
return UUID.fromString(input)
24+
}
25+
26+
return fromString(input)
2227
}
2328

2429
fun fromUUID(value: UUID): String {

0 commit comments

Comments
 (0)