Is there some way to use the JSONAPI spec with Retrofit?, don't know how this will work or how to start, any help?.
I found this gist: https://gist.github.com/Gregadeaux/cbcc3781fda9d7fa6498, it uses RxJava and some other libraries.
Also, is a converter needed?.
Thank you.
https://github.com/jasminb/jsonapi-converter is what you're looking for
from the docs
// Create object mapper
ObjectMapper objectMapper = new ObjectMapper();
// Set serialisation/deserialisation options if needed (property naming strategy, etc...)
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://yourapi")
.addConverterFactory(new JSONAPIConverterFactory(objectMapper, Book.class, Author.class))
.build();
// Create service using service interface
MyBooksService booksService = retrofit.create(MyBooksService.class);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With