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 is it done if the Json is an array? #6

Open
Rafelcf opened this issue Nov 24, 2020 · 2 comments
Open

How is it done if the Json is an array? #6

Rafelcf opened this issue Nov 24, 2020 · 2 comments

Comments

@Rafelcf
Copy link

Rafelcf commented Nov 24, 2020

I would like to know how the MainActivity and the ViewModel are made, if the Json is an array? Thank you

@emedinaa
Copy link
Owner

hi @Rafelcf , thanks for your comment. If you receive an array, just you need to change on the retrofit interface

https://github.com/emedinaa/kotlin-mvvm/blob/master/KotlinMVVM/app/src/main/java/com/emedinaa/kotlinmvvm/data/ApiClient.kt

for example :
interface ServicesApiInterface { @GET("/api/museums/") fun museums(): Call<List<Museum>> }

@Rafelcf
Copy link
Author

Rafelcf commented Oct 18, 2021 via email

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