kotlinx-datetime
kotlinx.serialization
kotlinx-datetime | kotlinx.serialization | |
---|---|---|
4 | 53 | |
2,449 | 5,449 | |
1.1% | 0.9% | |
8.0 | 8.5 | |
1 day ago | 1 day 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-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's the best way to calculate the number of days between two dates in Kotlin?
It depends, time has a complex and native bound legacy. But I bet you want this https://github.com/Kotlin/kotlinx-datetime and DateTimePeriod.
kotlinx.serialization
-
JSON5 – JSON for Humans
Good API design dictates that you should be flexible as to what you accept and strict about what you serve. Being flexible doesn't really break anything.
Elasticsearch and Opensearch both actually have partial support for JSON5 (comments), which is a nice feature if you want to document e.g. a complex query or mapping choice. It won't return any comments in the response. So it won't break other parsers. Implementing JSON 5 support like this is a valid thing to do for any server. More broad support for this in parsers would be nice.
I'd probably enable this on my own servers if this was possible. I'd need that to be supported in kotlinx.serialization. See discussion on this here: https://github.com/Kotlin/kotlinx.serialization/issues/797
-
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
-
kotlinx-serialization won't serialize a List?
Regardless, I followed the documentation to register List for polymorphic serialization and my static code analysis does not seem to be happy with it.
-
Is rust serde unique?
I think kotlinx.serialization might come close, but looks like custom Encoders and Decoders are still experimental.
-
[Android/Multiplatform] Kotlin Flows + Ktor = Flawless HTTP requests (- ArrowKt)
This example will not work on a multiplatform project. you are using gson, gson runs only on jvm, you should use https://github.com/Kotlin/kotlinx.serialization for the json parsing
-
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
-
Question about app weight... I want to use Apache commons math3, should I fork it and "crop" it to reduce compile times and app weight?
Fun fact, kotlinx.serialization had a release just recently which makes it come with some bundled proguard rules to make this experience easier. Yes you'll still have issues if you're using things via reflection and try to serialize things that proguard deemed unused and removed them, but it's a step forward https://github.com/Kotlin/kotlinx.serialization/releases/tag/v1.5.0-RC
-
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.
What are some alternatives?
koda-time - Joda Time and Java 8 Time Extensions for Kotlin
jackson-module-kotlin - Module that adds support for serialization/deserialization of Kotlin (http://kotlinlang.org) classes and data classes.
klock - Multiplatform Date and time library for Kotlin
Moshi - A modern JSON library for Kotlin and Java.
Kotlin-Multiplatform-Libraries - Kotlin Multiplatform Libraries. Welcome PR if you find or create new Kotlin Multiplatform Library.
klaxon - A JSON parser for Kotlin
krangl - krangl is a {K}otlin DSL for data w{rangl}ing
Gson - A Java serialization/deserialization library to convert Java Objects into JSON and back
swift-evolution - This maintains proposals for changes and user-visible enhancements to the Swift Programming Language.
spring-native - Spring Native is now superseded by Spring Boot 3 official native support
better-parse - A nice parser combinator library for Kotlin
kotlin-json - A JavaScript Object Notation library for Kotlin JVM.