Ok, so I’ll try to add more information.
Actually, this is the response of github to an user API request:
{
"login": "octocat",
"id": 583231,
"avatar_url": "https://avatars.githubusercontent.com/u/583231?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false,
"name": "The Octocat",
"company": "GitHub",
"blog": "http://www.github.com/blog",
"location": "San Francisco",
"email": "octocat@github.com",
"hireable": false,
"bio": null,
"public_repos": 5,
"public_gists": 8,
"followers": 1023,
"following": 6,
"created_at": "2011-01-25T18:44:36Z",
"updated_at": "2015-05-22T18:59:27Z"
}
I read the specification of the convention for a JSON response for ember here, but it’s not clear if it’s used also in the model hook inside a route (that is what I have done here).
If we apply the logic of Ember Data JSON convention we should consider that the ember serializer expects this kind of response from the API:
{
"user": {
"login": "octocat",
"id": 583231,
"avatar_url": "https://avatars.githubusercontent.com/u/583231?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat"
}
}
That is not the case of the github API response.
But the question is: does emberjs follow its JSON convention also for a raw data retrieving using model hook inside a route? Or is this convention specific to Ember Data?