[Solved] I'm testing with `buildJson` but is immut...
# serialization
f
[Solved] I'm testing with
buildJson
but is immutable and I can't add new JsonElements Any mutable alternative in Kotlin-serialization lib? My Scratch code:
Copy code
val files = buildJsonArray {
 ficheros.forEach {
  add(buildJsonObject {
      put("name", JsonPrimitive(it))
  })
 }
}
Ok, I resolved. If anyone knows alternatives, I would be grateful if you post it. My Solution:
Copy code
val files2 = files.toMutableList()
    files2.add(buildJsonObject {
        put("name", JsonPrimitive("fich3.mp4"))
    })
d
There should be a
putJsonObject
though.