Closed konklone closed 10 years ago
Returning an array ([]) reduces flexibility in including metadata about the response alongside the response itself (e.g. pagination information). Using an object ({}) and putting any "results" into an array field on that object is a better practice.
[]
{}
Returning an array (
[]
) reduces flexibility in including metadata about the response alongside the response itself (e.g. pagination information). Using an object ({}
) and putting any "results" into an array field on that object is a better practice.