I'm having trouble getting the Views REST export to work nicely with multi-value fields. I have an image field that can have multiple images. I have added the field to my REST export View, however all values are being output on the same line. Like this:
[
{
"nid": "11",
"image": "http://example.com/sites/default/files/2016-02/mobile-1.jpg\n, http://example.com/sites/default/files/2016-02/mobile-2.jpg\n"
}
]
What I would like to achieve is something like this:
[
{
"nid":"11",
"image":{
"0":"http://example.com/sites/default/files/2016-02/mobile-1.jpg\n",
"1":"http://example.com/sites/default/files/2016-02/mobile-2.jpg\n"
}
}
]
Is this possible? Perhaps using HOOK_views_pre_render() to change the returned value?