Comments (8)
@kurko Can you look at this, pls?
from ember-json-api.
Yes, @steffenbrem, let's do it! Here are my thoughts of what needs to be done:
- Add an attribute such as
useHrefLinks
set tofalse
in the adapter, which can be overridden by the developer. The idea is that not everyone/server/api will actually support such URLs, so we don't want to rely on that unless people are actually using it. We can change this to true by default later. - Include href into
links
only ifuseHrefLinks
istrue
. - Add this configuration to the README.
Regarding IDs, I think it should be included by default and removed if the developer wants. So, here's what I'd do:
- Add a flag such as
useIdLinks
set totrue
, which can be overridden by developers. - Include IDs into
links
only ifuseIdLinks
istrue
. - Add this configuration to the README.
What do you think?
I have #41 opened to keep track of these specs that we're covering. Please, see the tests on https://github.com/kurko/ember-json-api/tree/master/tests/integration/specs. Each one is a section from the JSONAPI.org page.
from ember-json-api.
@kurko I think both of them needs to be supported at the same time. That is how I have it implemented it right now, haven't tested it though but it should work fine. If you look at the spec, it is valid to only include a href as a link (Link to spec.). Note that they say: "A 'collection object' contains one or more of the members.". If you want, I can of course include the configuration, but I think it would be better to follow the spec and support both at the same time, won't break anything.
from ember-json-api.
The thing is that not everyone supports those URL, so it could be misleading. But I'm fine with it as long as it's in the README how to disable it.
from ember-json-api.
@kurko It will be disabled automatically if you do not include the href links inside the response document. So both examples that I showed in my post will still work exactly like you would expect.
from ember-json-api.
Oh my. Please forget everything I said so far lol
—Alexandre de Oliveira
On Thu, Oct 9, 2014 at 1:43 PM, steffenbrem [email protected]
wrote:
@kurko It will be disabled automatically if you do not include the href links inside the response document.
Reply to this email directly or view it on GitHub:
#43 (comment)
from ember-json-api.
@kurko I have a PR ready in a couple of minutes. Also have 1 test included.
from ember-json-api.
Closing this. #44 implements it.
from ember-json-api.
Related Issues (20)
- Null links are not handled properly HOT 2
- Publishing latest version to Bower HOT 7
- Using in browser HOT 3
- Why? HOT 5
- Model having `length` field causes problems HOT 1
- Related/linked entities don't load properly HOT 1
- How to set a belongsTo relationship to null ? HOT 1
- Request: track ember-data version numbers HOT 4
- JSON API 1.0 rc2 plans? HOT 13
- Set headers automatically? HOT 2
- Update Links Property href to resource HOT 2
- Warning: package `ember-json-api` is not a properly formatted package HOT 9
- Need to replace "data" with key for type? HOT 2
- JSON API rc3/1.0 updates? HOT 2
- modelNameFromPayloadKey not called HOT 1
- Support for JSON API 1.0 HOT 28
- Adapter.findHasMany error on snapshot.hasMany(relationship.key) HOT 7
- Passing query parameters seems to break things HOT 2
- [Meta Issue] Deprecating in favour of official Ember Data adapter HOT 7
- Not a properly formatted package HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-json-api.