fuel
fuel copied to clipboard
How to Deserialize Lists with kotlinx-serialization
The tilte refers; I've tried the method suggested in the Fuel documentation but it is no longer supported
how would one go about serializing and deserialising a list of objects.
Given:
@Serializable
data class MyClass(
val x : Int
)
You can do
val (_, _, result) = "http://localhost:1080".httpGet()
.responseObject(
loader = ListSerializer(MyClass.serializer()),
json = Json.Default
)