I wanted to switch from Jackson to kotlinx seriali...
# serialization
o
I wanted to switch from Jackson to kotlinx serialization. But in my project I use two aspects heavily:
@JsonRawValue
for a string that already IS a valid Json string that needs to be put into the encoded result without any intervention, no escaping, nothing - and secondly I always work on unknown structures using
Map<String, Any?>
as my data values. How can kotlinx-serialization do these two things?
👍 1
t
I am also interested if anyone have a working solution for deserialization unknown structures into map.
👍 2
a
You can deserialize into JsonElement, which represents objects as Map<String,JsonElement>
o
Thanks, that's something. But sadly I am coming more from the serialization side and having my incoming data as JsonElement would make it tightly coupled to the kotlinx serialization library, which I wanted to avoid...