Is there support for JSONL (not JSON) format in th...
# serialization
y
Is there support for JSONL (not JSON) format in the library?
c
Jsonl is just normal JSON, but with 1 object per line in the file. You just need to read the file line by line and decode each line individually. Something like this should do the trick:
Copy code
val jsonRecords: List<JsonElement> = File("logs.jsonl")
    .useLines { lineSequence ->
        lineSequence
            .map { line ->
                Json.decodeFromString(JsonElement.serializer(), line)
            }
            .toList()
    }
🙌 1