I would be interested to know if there are rules for how the data should be returned in an Api response. Should the data be returned in an object with the key data or should the object be returned directly? I would like to decide between these two response formats.
// version 1
{
"data": [
{"id":1,"name":"Mexico City"}
]
}
// or version 2
[
{"id":1,"name":"Mexico City"}
]
// or version 3
{
"cities": [
{"id":1,"name":"Mexico City"}
]
}