where datapoint: ```@Serializable data class Data...
# getting-started
b
where datapoint:
Copy code
@Serializable
data class DataPoint (
        val name: String,
        val value: Double
)
When I try that:
Copy code
val list = mutableListOf<DataPoint>()
                        list.add(DataPoint("A", 1.34))
                        val foo = JSON.stringify(DataPoint::class.serializer().list, list)
I get a
Copy code
Can't locate default serializer for class class gui.DataPoint
s
you ought to surround with ` ``` ` for ease of reading
👍 1
b
I also tried:
Copy code
@Serializable
data class DataPoint (
        val name: String,
        val value: String
)

@Serializable
data class DataPoints (
        val elements: MutableList<DataPoint>
)
with
Copy code
val liste = DataPoints(elements = mutableListOf())
                        liste.elements.add(DataPoint("A", "1.34"))
                        val foo = JSON.stringify( liste)
plugin("kotlinx-serialization") was missing…
s
ahhh
b
But it is for use in webview and I can't see how to do that without writing a full string parsing library…