Put the lines of code in the correct order to get the list of cats.
JSON Moshi Library
Deserialisation
Report a typo
Put the items in the correct order
val type = Types.newParameterizedType(List::class.java, Cat::class.java)
val catList = catListAdapter.fromJson("[{\"name\":\"Barsik\"}, {\"name\":\"Masya\"}]")
.add(KotlinJsonAdapterFactory())
val catListAdapter = moshi.adapter<List<Cat?>>(type)
.build()
val moshi = Moshi.Builder()
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.