Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Deserialize Lists with kotlinx-serialization #817

Open
geofferyj opened this issue Oct 5, 2021 · 1 comment
Open

How to Deserialize Lists with kotlinx-serialization #817

geofferyj opened this issue Oct 5, 2021 · 1 comment

Comments

@geofferyj
Copy link

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.

@Kantis
Copy link

Kantis commented Oct 13, 2021

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
         )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants