devour-js / devour-client

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

Deserializer middleware drops relationships from included resources to resources that appear in the main document #172

Closed k8n closed 5 years ago

k8n commented 5 years ago

A hack for possibly higher fidelity; with tests.

Priority

Seems pretty important

What Changed & Why

main document resources are merged with included resources before deserialization begins

Testing

See tests

k8n commented 5 years ago

@auspicus should I tack the tests onto #153 at least? There are some corner cases.

Auspicus commented 5 years ago

@k8n Yeah, if you could add any tests you think aren't included in there that'd be great.

Auspicus commented 5 years ago

@k8n I'm actually going to deploy the fix since this is a pretty annoying bug to deal with, if you could setup a separate PR adding the tests in I'll get that in ASAP.