kurko / ember-json-api

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

URL templating not complete #15

Closed stefanpenner closed 9 years ago

stefanpenner commented 10 years ago

url templating is only aware of the current model's ID, but to be compatible actually needs reference to the entire model.

This may need some ember-data level adjustments, but well worth it.

example:

{
  "links": {
    "posts.comments": "http://example.com/comments/{posts.comments}"
  }
}

the built url, incorrectly templates {posts.comments} with the primary models id.

http://jsonapi.org/format/#document-url-template-shorthands elaborates other variations.

(cc @rjackson you mentioned similar ideas earlier today)

stefanpenner commented 10 years ago

old PR from @rjackson: https://github.com/rjackson/ember-data-nested-urls/blob/master/config/adapters/nested_url.es6.erb

@igort thoughts?

kurko commented 10 years ago

ping

jonkoops commented 9 years ago

@stefanpenner @wecc I assume work for this has been done in the official Ember Data adapter?

igorT commented 9 years ago

This can be closed as this is no longer in JSONAPI

kurko commented 9 years ago

@jonkoops closing. I think we'll deprecate the lib before this issue ever has a chance to be fixed.

jonkoops commented 9 years ago

@kurko Definitely, just making sure this isn't anything that should be implemented in the official.