GithubHelp home page GithubHelp logo

Comments (6)

dgeb avatar dgeb commented on September 27, 2024

@pixelhandler So, as the author of the recent JSON API rewrite, this is rather embarrassing for me...

The fact is that the JSONAPISource is not yet compliant with JSON API. I originally wrote this source as a simple RESTSource, with no concept of primary and linked resources, and with the intention of developing a JSONAPISource separately. However, I grew uncomfortable with the implications of writing such a generic source without a spec to follow, and didn't want to support such a source indefinitely.

I'm planning to get back to this in the next few days, after straightening out some module issues, and before I write my JSON API example project. I'll take a peek at your blog too and might use it as a sanity check for the updated source.

from orbit.

tute avatar tute commented on September 27, 2024

I'll be developing my app against memory and localStorage sources meanwhile, knowing that plugging in new sources shouldn't be that hard following stds and predefined APIs. @dgeb if you need any help making JSONAPISource more compliant I'm happy to help, will just need a little guidance at the beginning. Thanks for your work!

from orbit.

tute avatar tute commented on September 27, 2024

Question @dgeb: ember-data is highly compliant with JSON API, right? Meaning, if I've got an API working well with ember-data 1.0.0-beta.8 (latest), it is expected that a compliant JSON API Source would work well with it (and will significantly differ from current orbit's implementation)?

As always, thank you so much for your good work.

from orbit.

dgeb avatar dgeb commented on September 27, 2024

@tute I believe this is currently the most JSONAPI-compliant adapter for ember-data: https://github.com/daliwali/ember-json-api

It was recently updated by @stefanpenner to include tests and be more compliant.

from orbit.

dgeb avatar dgeb commented on September 27, 2024

@pixelhandler the underlying incompatibility with JSON API has been fixed in master.

I created pixelhandler/blog#3 to resolve the problem in your branch. You'll need to rebuild orbit and ember-orbit in order to get this working.

Note that JSON API now expects requests for singular resources (such as /posts/:slug) to return singular objects not in arrays. This was a breaking change in the 1.0rc1 rewrite of JSON API. I left this broken, since I thought it would be better to fix your server response rather than customize the orbit serializer.

from orbit.

pixelhandler avatar pixelhandler commented on September 27, 2024

Awesome @dgeb looking forward to trying it out. Yeah I'll need to change the api as you mentioned. I'm on vacation this week so I'll give it a shot next week. Thanks for the PR!

from orbit.

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.