Richard
01/24/2023, 3:42 PM@JvmInline
value class UserId(value: UUID)
It serializes to a nice UUID string, but turning that back into a class seems to involve substantial boiler plate using Jackson or kotlin serialization libsEmil Kantis
01/24/2023, 4:00 PMtypealias UuidAsString = @Serializable(with = UuidSerializer::class) UUID
@JvmInline
value class UserId(value: UuidAsString)
(the typealias should be added to the lib, at which point you'd just need to import it instead)
Or just specifying it directly: (IIRC)
@JvmInline
value class UserId(@Serializable(with = UuidSerializer::class) value: UUID)
Richard
01/24/2023, 5:50 PM