kamikat / moshi-jsonapi

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

References to objects in array documents and object documents #110

Open kubak89 opened 4 years ago

kubak89 commented 4 years ago

According to this discussion on Json:API forums, resources in primary data may have relationships with other resources that are also there (e.g. two "people" type resources with HasOne relationships referencing each other in "spouse" field). The library have not supported such a case, so I added find(ResourceIdentifier) method overrides in ArrayDocument and ObjectDocument that allow searching for referenced Resource in data field.

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-0.006%) to 82.262% when pulling dbc984dbf1e6cacb772fcbbe6a6d79083d5ddb90 on codequest-eu:references-to-objects-in-array-documents-and-object-documents into 3582cd6bfbaf1ac29fbeb4cb1d3ed340cdbd55ad on kamikat:master.