Skip to main content
Filter by
Sorted by
Tagged with
2 votes
2 answers
105 views

In this thread, (de-)serializing a nested polymorphic object is described for open (runtime) polymorphism. How can the same be achieved for closed (static) polymorphism? That is, how can a ...
Noah's user avatar
  • 3,557
1 vote
0 answers
72 views

I've tried to use kotlinx.serialization with the third party Yaml plugin from @charleskorn. In the past I already did something with Python using pyyaml, where I explicitly set a custom yaml_tag for ...
9Lukas5's user avatar
  • 91
0 votes
0 answers
64 views

I'm working on a Spring WebFlux + Kotlin + Redis project and noticed a performance gap between two caching approaches. Specifically, using @Cacheable with a custom serializer is significantly faster (~...
Pawandeep Singh's user avatar
0 votes
0 answers
77 views

I have found such kinds of error while calling Web Apis when json response is too large. Throwing OutOfMemoryError "Failed to allocate a 104643040 byte allocation with 25165824 free bytes and ...
Nisha Khatoon's user avatar
1 vote
1 answer
72 views

I want to use the standard kotlinx JsonElement in my data models but translate between jooq.JSON as necessary. Can I do this without going through string serialization?
Emre's user avatar
  • 6,269
0 votes
1 answer
43 views

Performing a deserialization of a response from a restful service we get back a decimal data where we try to receive it as a Double, however when operating it, it remains as scientific notation for ...
Juan Esteban Lopez's user avatar
0 votes
0 answers
121 views

I just learn ktor-client and kotlinx.Serialization for my personal project, but then I found this error. kotlinx.serialization.SerializationException: Serializer for class 'Result' is not found....
Raffly Pohan's user avatar
0 votes
2 answers
145 views

I'm using KTOR as a Http Client for my CMP app. I'm wondering if somehow I can omit wrapper class when fetching data from an API and directly load them into the DTO. Below is my setup: API response: &...
mikolaj-jalocha's user avatar
0 votes
0 answers
54 views

I have a parent class RequestFieldResponseBody and two classes that inherit from it (CreateRequestFieldBody and EditRequestFieldBody). I would like to make it so that depending on the child class my ...
onesector's user avatar
  • 471
0 votes
1 answer
49 views

I'm working on an Android app where I get some data from an API with two properties - one is an enum that describes the data, and the other is the value. The problem I'm having is that the value can ...
daniel-eh's user avatar
  • 414
2 votes
1 answer
108 views

Context versions in use kotlin: 2.0.20 kotlinx-serialization: 2.0.20 kotlinx-io: 0.5.4 I've been following the kotlinx-serialization Custom formats guide to implement a custom binary protocol and ...
Jamal Khan's user avatar
0 votes
0 answers
116 views

I would like to deserialize a generic cbor object using kotlinx-serialization, without knowing much about its structure. Basically an equivalent to a JsonObject, but for Cbor. Is it possible to ...
acheloil's user avatar
0 votes
1 answer
110 views

Problem While integrating MongoDB with a Ktor server using @Serializable for data classes, I encountered the following error: Reading field '_id' failed expected STRING type but found: OBJECT_ID The ...
Valentin Valencia Valencia's user avatar
0 votes
0 answers
43 views

I am currently looking for a way to partially parse json and postpone parsing of certain structures. In other words, I want to indicate that field should be kept as rawJson / string even though it is ...
Tambosa's user avatar
4 votes
2 answers
821 views

I want to pass a list of objects to another composable screen through Typse safe navigation but I get this error: Route com.home.ui.OwnerGraph.FirstLogin.FirstLoginScreen2 could not find any NavType ...
No_Name's user avatar
  • 333
0 votes
0 answers
17 views

I have a list value in a data class that, when only one element is present, may be serialized by only serializing that one element. The serialized value may therefore be a serialized list of elements ...
acheloil's user avatar
1 vote
0 answers
149 views

I am using Kotlinx serialization in my KMP project. This is the plugins section of the build.gradle file for shared module: plugins { alias(libs.plugins.kotlinMultiplatform) alias(libs.plugins....
Muhammad Ahmed AbuTalib's user avatar
3 votes
1 answer
643 views

I'm implementing navigation in a Jetpack Compose app using the Navigation Component and experiencing serialization issues. I have two related problems: When I remove default values from my User data ...
OmniCoder77's user avatar
0 votes
1 answer
66 views

I need to utilize an existing database structure which has Entity classes compatible with JPA (Jakarta Persistence API) for use in Spring Boot via the Hibernate ORM. I want to basically copy this ...
moonlightcheese's user avatar
1 vote
0 answers
88 views

I have a couple of data classes like below data class Base ( val prop1: String, val prop2: String ) data class Derived ( val base: Base, val prop3: String ) The serialized form of Derived ...
Pazhamalai Arun's user avatar
0 votes
0 answers
91 views

I am attempting to deserialize a YAML config that has mono/multilingual strings in multiple places, such as: key1: File # or key2: en_US: File de_DE: Datei Using kotlinx.serialization and ...
Jan Schultke's user avatar
  • 43.7k
1 vote
1 answer
102 views

I'm working on a simple chat server, using kotlin to learn it along the way I've defined the class to store any message as @Serializable data class Message ( var id: Int = messageCounter....
JustAnotherDev's user avatar
3 votes
1 answer
174 views

Please help me with my problem. I have to deserialize this file using kotlinx.serialization and kaml rootElement: id: 10 name: Some name to data class @Serializable data class SomeData( val ...
TenebrisUltorem's user avatar
0 votes
2 answers
109 views

I'm trying to read the following data from the API: [ [ 1724180400000, "59191.45000000", "59597.28000000", "59137.78000000", &...
Marc's user avatar
  • 55
4 votes
1 answer
530 views

I'm trying to encode a sealed class json.encodeToString( Filter.NOT( Filter.Field( name = "foo", value = "bar" ...
Jan Vladimir Mostert's user avatar
1 vote
2 answers
105 views

Issue description: When I try to create custom navigation type and navigate to certain destination in my NavGraph, I get error, which states, that this certain destination cannot be found in the graph....
Cuyer's user avatar
  • 76
0 votes
1 answer
55 views

We've got following structure: sealed interface Option<T> : IFeature { var value: T abstract val parent: OptionContainer val onChange: (T) -> Unit fun set(newValue: T) { ...
OffeeX's user avatar
  • 79
1 vote
1 answer
164 views

I have a retrofit api interface with a method that looks like this: @GET("/data") suspend fun getData(): DataDto? The server in this instance is returning a 200, and the json response ...
Mark's user avatar
  • 2,582
1 vote
1 answer
830 views

Hi everyone I have the following code that I use to serialize into json strings to store in shared preferences interface Serializer { public fun <T> serialize(data: T, type: Class<T>): ...
Abdelrhman Talat's user avatar
1 vote
2 answers
756 views

Given a data class like: @Serializable data class Person( val name: String, val birthDate: Long, ) { val age get() = /* calculate age */ } How do I include age in serialization? I know ...
Simao Gomes Viana's user avatar
3 votes
2 answers
316 views

Given this JSON: [{"name": "test"}]. Is there a way I can parse this JSON array directly into an Arrow NonEmptyList? My background is Scala and I'm exploring Ktor + Arrow. I have ...
LightSystem's user avatar
0 votes
1 answer
219 views

With kotlinx.serialization 1.6.3 on kotlin 1.9.23, I am trying to serialize a type hierarchy (BaseContainer, see example) with a restricted generic type parameter. The generic type itself is a sealed ...
Ulrich Schuster's user avatar
4 votes
0 answers
295 views

I'm interested in using kotlinx.serialization in my project, but it wasn't built by any of the build tools (Maven, Gradle, something else). I have access to the classes and annotations, but when it ...
Eitan's user avatar
  • 51
0 votes
1 answer
51 views

I have two JSON to deserialize like this: { "type": "cat", "animal": { "color": "red", "canJump": true }} { "animal": { "...
user2545386's user avatar
1 vote
1 answer
269 views

I'm working with an API that returns an empty string instead of null to indicate the existence of a property, i.e.: { "id": 1, "child": { "foo": "bar" } // ...
harrisonlee's user avatar
  • 5,118
2 votes
1 answer
670 views

How can I serialize the below data? This is AppConfig and the value of value could be any type and I can't use Any for serialization. [ { "key": "PROFILE_PHOTO", "...
Abdullah's user avatar
  • 393
2 votes
0 answers
147 views

When using kotlinx.serialization and encoding data as JSON, it's possible to write serialized data directly into an OutputStream, via Json.encodeToStream(SerializationStrategy<T>, T, ...
Андрей Щеглов's user avatar
1 vote
0 answers
103 views

So I noticed the following crashes at Firebase Crashlytics of my app which happens only for a couple of devices (so rarely) but still it happens: Fatal Exception: java.lang.VerifyError Verifier ...
user924's user avatar
  • 12.9k
2 votes
0 answers
268 views

I have the following model for an api response: @Serializable public data class Response<out T>( val code: String, val message: String, val data: T? = null, ) The thing is that the ...
Kleckus's user avatar
  • 303
0 votes
1 answer
112 views

Our API returns a reserved_stock field that can be either a String or an Int (i.e. "158" or "5"). Since I cannot alter the API's response directly, I have to figure out a way to ...
Stelios Papamichail's user avatar
1 vote
1 answer
1k views

I have a need to deserialize JSON models into a strict hierarchy of classes with a strong forwards compatibility requirement. This is done with closed polymorphism with sealed classes according to ...
Calamity's user avatar
  • 1,060
1 vote
1 answer
117 views

I get the following JSON from an API to describe an object with different entries. { "entries": [ "Simple Text", { "type": "list"...
QT123's user avatar
  • 13
0 votes
1 answer
338 views

Consider the following json structure representing a basic check-in information { "id": "53481198005", "date": "1995-01-01 00:00:00", "latitude":...
Peanutbutter's user avatar
0 votes
1 answer
1k views

I have a data class that inherits from a sealed class that I want to serialize into a java.util.ConcurrentLinkedQueue. @Serializable sealed class A @Serializable data class B : A { val x: String, ...
toshiomagic's user avatar
  • 1,717
0 votes
1 answer
849 views

I'm using kotlinx.serialization in a KMP sdk for response parsing. I've seen that the properties module can be used to easily create the query map from a given class (I'm using interface inheritance ...
DadiBit's user avatar
  • 821
0 votes
1 answer
230 views

Consider the following deserialization in Ktor setup context: A simple model to deserialize JSON requests (aims to receive/store only Strings): @Serializable data class TestingDTO(val texts: List<...
Lucas Sousa's user avatar
1 vote
1 answer
688 views

I encountered a problem when receiving data from the backend that the resulting field (for example, "somethingField") could be either a String or an Object with two Int lists. How can you ...
Сергей Беляков's user avatar
2 votes
1 answer
820 views

I am trying to serialize a nested sealed class. Here is an example @Serializable sealed class Base { @SerialName("concrete_property") val concreteProperty: String = "concrete ...
brzi_gonzales's user avatar
1 vote
2 answers
2k views

Question Hi I'm new to kotlinx serialization. the json is snake case, and kotlin data class uses camel case. is there a way to parse snake case by using custom serilizer and deserializer? I know how ...
Jerry's user avatar
  • 523
0 votes
0 answers
65 views

using kotlinx and given a JSON input like {"a": 123, "b": "foo", "c": false}, is there a smart way to have this deserialized into a POJO where the property ...
Bakkenrak's user avatar
  • 143

1
2 3 4 5
7