kotlinx.serialization
kotlinx.serialization copied to clipboard
Kotlin multiplatform / multi-format serialization
All `build.gradle` and `settings.gradle` files must be transferred to Kts (`build.gradle.kts` and `settings.gradle.kts`) without changing the build logic.
A matrix should be drawn up between language features (value classes, abstract classes, sealed classes, nested classes, etc.) and serialization features (generated serializer, custom serializer, contextual serializer, etc.) and simple...
**What is your use-case and why do you need this feature?** Polymorphic deserialization on stream also expects a well performance. **Describe the solution you'd like** Would using `InputStream#mark` and `InputStream#reset`...
```kotlin @Serializable enum class TestEnum(val value: Int) { @SerialName(value = "1") V1(1), @SerialName(value = "2") V2(2); } fun main() { val json = Json.encodeToString(listOf(TestEnum.V1, TestEnum.V2)) println(json) } ``` Code above...
**Describe the bug** I'm running into an issue where I need to use a `JsonContentPolymorphicSerializer` on a nested sealed class. The children of the nested sealed class share the same...
**What is your use-case and why do you need this feature?** `JsonContentPolymorphicSerializer` is a very useful abstract class and I have used it quite a few times, but now I...
We have a lot of reports in slack with `Your current kotlinx.serialization core version is too low, while current Kotlin compiler plugin 1.4.0 requires at least 1.0-M1-SNAPSHOT. Please update your...
The kotlin-serialization library crashes with a null pointer exception when initializing the Serializer in the code of a third-party library compiled with an older version of kotlin. When using such...
I faced a problem with sealed classes serialization. **To Reproduce** ``` import kotlinx.serialization.Serializable import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json @Serializable sealed class Project { abstract val name: String @Serializable class OwnedProject(override val...
I'm writing Kafka serdes where `null` has a very special meaning (tombstones). I do want to keep the nullability information for the type parameters, but I don't want the serializer...