kamikat / moshi-jsonapi

JSON API v1.0 Specification in Moshi.
MIT License
156 stars 34 forks source link

How to retrieve included resources and relationships? #3

Closed lordplagus02 closed 8 years ago

lordplagus02 commented 8 years ago

In this scenario, I have a Client class and a Contact class, and a relationship such that Client has a field private ArrayList<Contact> Contacts;. My API returns a Client with its list of Contacts as an included resource. Is it possible to somehow retrieve the included resources using resource.relationships()? There does not appear to be much documentation on working with object relationships in moshi.

kamikat commented 8 years ago

Yes, and we're working on the feature. As of 1.0.16, the library simply parses relationships to linkage object(s) and does not resolve a relationship to it's resource representation.

BTW, we're working on version 2.x of moshi-jsonapi with relationship resolve.

kamikat commented 8 years ago

Checkout new feature in 2.0.1 and the issue should now be closed 🍻