shez1983's avatar

Api - JSON format for relation

Ok i have a query, when I attach relation results, it wraps that in data{} object so i get something like

{  data: {
   'user_id: 22,
    ....
    reviews:{
       data: []....    
    }
}

is this inner data[] a standard? my mobile devs were saying it makes it harder for them to parse this..

ie they would prefer if i didnt wrap taht in data so they got:

reviews: [

]

but I am using Fractal/Dingo etc who do this automatically

0 likes
1 reply
willvincent's avatar
Level 54

I don't know how 'official' it is, but it looks like it adheres to the JSON API specification.. so it is following a spec, whether you want to call that a standard or not is debatable... ;) Though, looking at their list of client and server implementations it looks like it's pretty widely adopted, so that could be considered a standard I suppose.

Please or to participate in this conversation.