Do I have to create serializers for Java types? Fo...
# announcements
h
Do I have to create serializers for Java types? For example UUID and Instant or is there some library available for it?
s
h
I have it working for standard Kotlin types but I get
Serializer has not been found for type 'UUID'
for example
I have read (knock, knock) those links but they are voluminous to say the least and I am in Maven land which seems a bit like second hand 🙂
m
I see, so you need to write a custom serializer for it, which probably just uses its toString(): https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md#custom-serializers
h
Ah I was hoping that the standard JVM typs had serializers somewhere
m
in the principal README there are instructions on how to configure kotlinx.serialization in a pom, so no one excludes Maven 😉
If the type you need hasn’t an explicit
.serializer()
function (generated by the compiler) then you either need to annotate the class (you own it) or you need to write a custom one. UUID seems the latter case
h
Thanks! Ill get to writing serializers now 🙂
👍 2
s
@Matteo Mirk how would we forget mvn anyway
m
surely not, maven is still strong, but I can understand Henrik because Gradle is preferred in Kotlin world, many docs only mention Gradle configurations and MPP only works with it
👍 2
s
yeah, I think people like Gradle a lot these days, not only in the Kotlin community
m
personally I haven’t still got into it, but every config seems very chaotic to me because it’s code and so there are 1000 ways of writing it. As of now I still prefer Maven, even with its limitations.
s
Yeah I agree, I am undecided, but well, I’ll stick to what the team prefers, both tools work of course
I’ve the impression Gradle can get sometimes quiet complex for me (really TMTOWTDIs)
m
The best evolution for Maven would be Polyglot Maven, but sadly it’s little known 😕
s
phew!
that’s interesting
m
yeah it is! The best part to me is that you can use Yaml and get rid of XML, or you can use one of the supported languages to reproduce the pom configuration AND use code where it’s needed without resorting to maven plugins
s
well I will consider this eventually when I have the lead
👍 1
😄