Hey Spyros,
The pragmatic approach would be to send it in exactly the way you are going to use it.
But I would prefer a "flat" solution, as follows:
GET /items
{ "entities": [ <item1>, <item2> ] }
You can then add a filter:
GET /items?parent_id=1
If you need the expanded tree, you can add a parameter to the root item query
GET/items/1?expanded=true
GET/items/root?expanded=true (use "root" slug for root element if id isn't one)
This enables you to get a expanded subtree too.
Of course, if your tree is very, very big and only accessed as a while, it makes more sense to make expanded=true the default and just call it on root once.
Op maandag 19 januari 2015 13:26:07 UTC+1 schreef Spyros Ioakeimidis: