Skip to content

Instantly share code, notes, and snippets.

@dadamssg
Last active December 29, 2015 03:08
Show Gist options
  • Select an option

  • Save dadamssg/7605129 to your computer and use it in GitHub Desktop.

Select an option

Save dadamssg/7605129 to your computer and use it in GitHub Desktop.
//Why are collections namespaced and single entity responses not? For example:
[
{
"name": "Hulk Hogan",
"id": "100002"
},
{
"name": "Mick Foley",
"id": "100003"
}
]
//the above seems more consistent with the following
{
"name": "Phil Sturgeon",
"id": "511501255"
}
//or provide the resource type with the single entity response as well
{
"users": [
{
"name": "Hulk Hogan",
"id": "100002"
},
{
"name": "Mick Foley",
"id": "100003"
}
]
}
//single entity response
{
"user": {
"name": "Hulk Hogan",
"id": "100002"
}
}
@dadamssg
Copy link
Author

@philsturgeon thanks. that makes sense. I was going to bring up the possibility of meta data being returned but i can't think of any meta data that would make sense to return with a single entity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment