Get JSON from internal rest() call
I'm making some REST calls within a custom component. Rather that traverse a nested response object in FreeMarker, I'd prefer to receive a JSON string, which I could insert as a data-* attribute on one of the HTML nodes in my custom component and deal with on the client-side using JavaScript. So I'd like to do something like this:
<div class="hidden my-data" data-board-topics="${
rest("/boards/id/extensions/topiclist?restapi.format_detail=full_list_element&restapi.response_format=json")
}">
However, when I append "&restapi.response_format=json" to the rest parameter, it still returns a nested response object, not a JSON string. I know I can get JSON by making an external REST API call from the client side, but is there a way to get a JSON string from the internal rest function?