I am rebuilding an API in Drupal. The structure of the JSON must remain the same.
I am using Views and Draggable Views so the user can order items on an overview page. I Enabled the view for exporting REST JSON.
The response JSON must have a structure like this
{
items: [{...},{...}]
}
But currently views output is like this
{[{...},{...}]}
I already managed to get my desired output without views and a special export controller but unfortunately, I need draggable views in additions to views. I also managed to create nested structures with Entity Normalizers inside an item but I want the whole output of the view is wrapped in "items". Any help would be appreciated.