kurko / ember-json-api

JSON API adapter for Ember Data.
MIT License
254 stars 62 forks source link

Parse top-level "meta" and "links" objects #2

Closed gr0uch closed 9 years ago

gr0uch commented 11 years ago

This should enable an API client to not worry about hard-coding resource paths, and also add the possibility to extract extra information from the top-level "meta" object.

GavinJoyce commented 11 years ago

This would be nice, I'm currently getting Assertion failed: No model was found for 'link' errors for the following json:

http://restpack-serializer-sample.herokuapp.com/api/v1/albums.json?includes=artists,songs

I'm not that familiar with Ember Data adapters. Is there much involved in adding support for this? Do you know of any other adapter that does support something similar?

gr0uch commented 11 years ago

Ah, a temporary fix I can implement is to omit the top-level meta and links objects. But to actually solve this, I will have to keep a record of paths to resources, and override the buildURL and pathForType methods. I'm not aware of any other JSON API adapters for Ember. I am currently unemployed so I will get to it soon enough.

GavinJoyce commented 11 years ago

Thanks. I'm exploring the ember data internals and I'll contribute where I can when I'm up to speed

gr0uch commented 11 years ago

I've added preliminary support for this. The caveat is that each model type can only have one route associated with it for now, so if you're trying to get artists by album or artists by song, it won't work as expected.

jonkoops commented 9 years ago

@daliwali Is this issue still relevant or can I close it? I'm doing some cleaning.

gr0uch commented 9 years ago

OK to close.