greptilian logo

IRC log for #rest, 2018-05-24

https://trygvis.io/rest-wiki/

| Channels | #rest index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
07:15 Haudegen joined #rest
07:18 interop_madness joined #rest
07:18 interop_madness joined #rest
08:21 interop_madness joined #rest
11:42 bizolos joined #rest
11:44 bizolos Hi there. I have a debate with a friend about how to implement a REST API, about nested resources. Let's say I want to do a Trello-like. You will have for example an end-point to get the trello board ("/boards/{id}" for example), and then an endpoint to get the colums ("/boards/{id}/columns"), then an endpoint to get the cards ("/boards/{id}/columns/{columnId}/cards").
11:45 bizolos This means that you could have potentially 150 HTTP calls to build the board in your front app (let's say an SPA).
11:45 bizolos The question is: is there a workaround for this? Are we allowed in the REST principles to do something like "/boards-with-all-nested-resources/{id}" ?
11:46 bizolos And have all the colums and cards in one call?
11:46 pdurbin Some sort of "batch import". Sure, go for it.
11:49 bizolos So create a specific endpoint with everything included is ok? What would be the best practice then?
11:54 pdurbin It sounds like you're talking about a representation of an entire board.
11:57 bizolos So it would not sound weird to include everything (nested on 2 or 3 levels?) when retrieving a board on /boards/{id} ?
11:59 pdurbin Well, what if you had an endpoint to download an entire board? What would that look like?
12:02 bizolos That's the question ^^. My friend states that I should not be able to download it in one call, if I follow the REST convention, it's not the API job to serve the whole board, but the client job to build it, following all the endpoints.
12:03 pdurbin You don't need friends like that.
12:05 bizolos Haha. It's a debate. We're just wondering if the specs say something about this kind of problem/situation.
12:07 pdurbin Maybe you could open an issue about this at https://github.com/trygvis/rest-wiki/issues
12:09 bizolos Thanks pdurbin :)
17:18 wsieroci joined #rest
19:34 Guest34186 joined #rest
19:34 Guest34186 joined #rest

| Channels | #rest index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

https://trygvis.io/rest-wiki/