devour-js / devour-client

Don't just consume your JSON API, Devour it...
https://www.npmjs.com/package/devour-client
ISC License
428 stars 90 forks source link

Expose the whole document too #237

Closed tijn closed 2 years ago

tijn commented 2 years ago

What Changed & Why

In JSON:API the server responds with data structure called a document. Devour-client will process it for us; it combines attributes and relationships etc. to obtain resources that are very easy to handle. However Devour will omit certain things in the deserialisation process. URLs in relationships for example. In most cases you don't need these, but if you do, there's really no way to obtain them and you're stuck.

This PR exposes the whole document as it was returned by the server to allow for a way around the deserialisation process.

auvipy commented 2 years ago

well JSON:API 1.1 is not fully supported by our library, does it?

tijn commented 2 years ago

well JSON:API 1.1 is not fully supported by our library, does it?

@auvipy oh, I put the wrong link there, I meant this one: https://jsonapi.org/format/#document-structure . A document is nothing new.