18F / api-standards

API Standards for 18F
Other
486 stars 54 forks source link

With JSON, always return an object #11

Closed konklone closed 10 years ago

konklone commented 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.