How about creating array of nested resources, e.g. items for order. Is it implemented?
If not which of structures below looks better to you:
{
"data": {
"type": "order",
"attributes": {
"title": "First order",
"code": "123123123"
},
"relationships": {
"items": [{
"data": {
"type": "item",
"attributes": {
"name": "T-shirt",
"price": "12.50"
}
}
}, {
"data": {
"type": "item",
"attributes": {
"name": "Sunglasses",
"price": "50.00"
}
}
}]
}
}
}
{
"data": {
"type": "order",
"attributes": {
"title": "First order",
"code": "123123123"
},
"relationships": {
"items": [{
"type": "item",
"attributes": {
"name": "T-shirt",
"price": "12.50"
}
}, {
"type": "item",
"attributes": {
"name": "Sunglasses",
"price": "50.00"
}
}]
}
}
}