orbitjs / orbit

Composable data framework for ambitious web applications.
https://orbitjs.com
MIT License
2.34k stars 133 forks source link

Consuming RESTApi #717

Open aalasolutions-zz opened 4 years ago

aalasolutions-zz commented 4 years ago

Hi,

I have used orbit with ember with JSONAPI, very nice implementation. Now I need to work on app which backend is in RESTApi.

Is there any guide on how to use that? or if even this is implemented? if not any plans for that.

thanks

jugaadi commented 4 years ago

You can refer this page for more details.

aalasolutions-zz commented 4 years ago

@jakecraige well, i can not change backend which is in RESTAPI, i only can use that

selvagsz commented 4 years ago

@aalasolutions At this point, you'd probably need to build your own serializer to handle it. Extending the JSONAPISerializer & overriding the deserialize method would be great starting point.

https://github.com/orbitjs/orbit/blob/master/packages/%40orbit/jsonapi/src/jsonapi-source.ts#L144

janzheng commented 2 years ago

I have the same question — if we're working with a bunch of existing APIs and want to "connect" all the data into Orbit, do we always need to extend JSONAPISerializer? I feel like this is a rather common use case. Is there a util that takes any array of json objects and "maps" it according to a given schema and into memory?