Giter Club home page Giter Club logo

Comments (8)

koemeet avatar koemeet commented on September 22, 2024

@kurko Can you look at this, pls?

from ember-json-api.

kurko avatar kurko commented on September 22, 2024

Yes, @steffenbrem, let's do it! Here are my thoughts of what needs to be done:

  • Add an attribute such as useHrefLinks set to false 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 if useHrefLinks is true.
  • 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 to true, which can be overridden by developers.
  • Include IDs into links only if useIdLinks is true.
  • 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.

koemeet avatar koemeet commented on September 22, 2024

@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.

kurko avatar kurko commented on September 22, 2024

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.

koemeet avatar koemeet commented on September 22, 2024

@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.

kurko avatar kurko commented on September 22, 2024

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.

koemeet avatar koemeet commented on September 22, 2024

@kurko I have a PR ready in a couple of minutes. Also have 1 test included.

from ember-json-api.

kurko avatar kurko commented on September 22, 2024

Closing this. #44 implements it.

from ember-json-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.