Using my home-grown <Kotlin Schema Generator>, I’v...
# serialization
a
Using my home-grown Kotlin Schema Generator, I’ve undertaken a canonical set of kotlinx.serializable schemas for Mastodon. I’ve gotten to a place where I’m extremely happy with the Typescript schemas (which I transcribed from the web docs), and the Kotlin schemas! I have not yet tested them at runtime (I’m sure there are errors), but I suspect folks will find the outputs interesting (and hopefully useful, if your company has a typescript backend). Here are a couple examples. • https://github.com/asarazan/Tangent-Mobile/blob/main/api/entities/Status.d.tshttps://github.com/asarazan/Tangent-Mobile/blob/main/shared/src/commonMain/kotlin/social/tangent/mobile/api/entities/Status.kt
Figured it was relevant to this channel considering that it’s 100% kotlinx.serialization, and even leverages kotlinx.datetime 🙂
a
Is it possible to use it to generate K/JS externals ?
a
oooh that’s a good question-- I haven’t delved into the JS side for a while-- can you explain the use case?
a
It would be to automatically generated K/JS externals, there's a feature like that by default in Gradle K/JS but it often don't work, is very limited and doesn't work on new features (from around TS 4.3 to now) And for multiple packages I had to generate the typings entirely by hand (and it takes a lot of time to do this)