kotlinx.serialization
kotlinx-datetime
Our great sponsors
kotlinx.serialization | kotlinx-datetime | |
---|---|---|
52 | 4 | |
5,063 | 2,151 | |
2.2% | 3.6% | |
8.5 | 8.5 | |
1 day ago | 3 days ago | |
Kotlin | Kotlin | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
kotlinx.serialization
-
How would I serialize a JSON primitive to a class?
Have you tried this:? https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md
It might be possible with a value class
-
Is rust serde unique?
I think kotlinx.serialization might come close, but looks like custom Encoders and Decoders are still experimental.
-
Why should I use kotlinx.serialization?
This is the issue to +1 https://github.com/Kotlin/kotlinx.serialization/issues/1931
- Generate Kotlin client for a complex web API
-
Modern Android Development in 2023
Kotlin Serialization
-
Apple's Swift rewrite of its Foundation framework will be open source
Kotlin Serialization is also a newer option, but doesn't have as much traction.
-
Jackson, moshi or kotlinx.serialization?
``` see the docs
-
Connect-Web: It's time for Protobuf/gRPC to be your first choice in the browser
It makes sense for some use cases but the vast majority of use cases, parsing overhead is simply not a concern. Mobile phones are fast, networks have plenty of bandwidth (and the savings are marginal), parsers are pretty good.
But done right, binary protocols are sometimes worth the marginal savings they provide. We switched over one of our APIs to use CBOR instead of json. It's a search API that we hit a lot and I wanted to cut down on the bytesize of the responses a little. The savings are not that impressive. But I'll take 10% when i can get it.
Otherwise, this was a pretty simple change. We use kotlinx serialization in a multi-platform library. Basically, all we did is configure it to use CBOR instead of json. https://github.com/Kotlin/kotlinx.serialization/blob/master/... Half hour job. Haven't looked at it since; just works. It supports protobuf as well but it looked like more hassle to set up so we went with CBOR instead.
-
FP for web/mobile apps in 2022?
I'm very much with you on kotlinx.serialization's pain points. And unfortunately, there just doesn't seem to be much of a willingness to fix them. They seem very tied to their polymorphic/contextual serialization model, despite all the problems it causes.
kotlinx-datetime
-
Why should I use kotlinx.serialization?
Kotlin multiplatform types often come with their own serializers. https://github.com/Kotlin/kotlinx-datetime and https://github.com/hfhbd/kotlinx-uuid do, for example.
- Datas no Kotlin
-
Kotlin Team AMA #3: Ask Us Anything
But we do have such plans for our kotlinx-datetime library and expect to provide at least a partial solution during the course of the year
What are some alternatives?
jackson-module-kotlin - Module that adds support for serialization/deserialization of Kotlin (http://kotlinlang.org) classes and data classes.
Moshi - A modern JSON library for Kotlin and Java.
klaxon - A JSON parser for Kotlin
Gson - A Java serialization/deserialization library to convert Java Objects into JSON and back
koda-time - Joda Time and Java 8 Time Extensions for Kotlin
spring-native - Spring Native is now superseded by Spring Boot 3 official native support
kotlin-json - A JavaScript Object Notation library for Kotlin JVM.
klock - Multiplatform Date and time library for Kotlin
compose-multiplatform - Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
koin - Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform
Kotlin-Multiplatform-Libraries - Kotlin Multiplatform Libraries. Welcome PR if you find or create new Kotlin Multiplatform Library.
xmlutil - XML Serialization library for Kotlin