appendto/amplify — Issue #34: AJAX request success callback returns nested object
Author: cocoahero
Created: 2011-11-06 22:06:57+00:00
State: open

Hi,

I could be doing something ridiculously dumb, but I am trying to use amplify.request() to retrieve a user's github repos. Every example I read, the "data" parameter of the success callback is what it should be: the JSON deserialized into an object. However when I try and do this, the data parameter is actually an object with two properties, `data.meta` and `data.data`, with the `data.data` containing what I actually want.

Am I doing something wrong? Below is my source code.

```javascript
$(function(){
amplify.request.define("github-repos", "ajax", {
url: "https://api.github.com/users/cocoahero/repos",
dataType: "jsonp",
type: "GET"
});

amplify.request("github-repos", function(data) {
$.each(data.data, function(i, repo) {
alert(repo.name);
});
});
});
```

Thanks!