Data Transfer Objects
Data transfer objects, or DTOs, are objects used to wrap resource definitions in request/response objects along with additional information.
In a response body, you should return a JSON object, not an array, as a top level data structure to support future extensibility. This would allow you to extend your response and, for example, add a server side pagination attribute.
Bad response body
Good response body
Last updated