In Drupal 8, I'd like to retrieve JSON for multiple Rest export views, not just a single one. Example of data I want to see (cars and tires being two seperate content types):
{
"cars": [
{ "nid": 1, "brand": "BMW", "weight": 100, "compatible_tire_nids": [100,101,102] },
{ "nid": 2, "brand": "Mazda", "weight": 100, "compatible_tire_nids": [102] },
{ "nid": 3, "brand": "Volvo", "weight": 1000, "compatible_tire_nids": [103] }
],
"tires": [
{ "nid": 100, "brand": "Michelin" },
{ "nid": 101, "brand": "Good Year" },
{ "nid": 102, "brand": "Dunlop" }
]
}
I can output the JSON fine seperately, so you visit one url to get cars, and another URL to get tires. But I can't figure out how to merge the two.
Can anyone help me figure this out, or anyone who can point me in the right direction to achieve this?