Skip to content

Instantly share code, notes, and snippets.

@developerdino
Created September 7, 2017 05:59
Show Gist options
  • Save developerdino/32f8621adcb78a88a0fd6a4634dec774 to your computer and use it in GitHub Desktop.
Save developerdino/32f8621adcb78a88a0fd6a4634dec774 to your computer and use it in GitHub Desktop.
{
"data": [
{
"type": "articles",
"id": "1",
"attributes": {
"title": "JSON API paints my bikeshed!"
},
"relationships": {
"author": {
"links": {
"self": "http://127.0.0.1:8000/api/articles/1/relationships/author",
"related": "http://127.0.0.1:8000/api/articles/1/author"
},
"data": {
"type": "people",
"id": "9"
}
},
"comments": {
"data": [
{
"type": "comments",
"id": "5"
},
{
"type": "comments",
"id": "9"
}
],
"links": {
"self": "http://127.0.0.1:8000/api/articles/1/relationships/comments",
"related": "http://127.0.0.1:8000/api/articles/1/comments"
}
}
},
"links": {
"self": "http://127.0.0.1:8000/api/articles/1"
}
}
],
"links": {
"first": "http://127.0.0.1:8000/api/articles?page=1",
"last": "http://127.0.0.1:8000/api/articles?page=1",
"prev": null,
"next": null,
"self": "http://127.0.0.1:8000/api/articles"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "http://127.0.0.1:8000/api/articles",
"per_page": 15,
"to": 1,
"total": 1
},
"included": [
{
"type": "people",
"id": "9",
"attributes": {
"first-name": "Dan",
"last-name": "Gebhardt",
"twitter": "dgeb"
},
"links": {
"self": "http://127.0.0.1:8000/api/authors/9"
}
},
{
"type": "comments",
"id": "5",
"attributes": {
"body": "First!"
},
"relationships": {
"author": {
"data": {
"type": "people",
"id": "2"
}
}
},
"links": {
"self": "http://127.0.0.1:8000/api/comments/5"
}
},
{
"type": "comments",
"id": "9",
"attributes": {
"body": "I like XMP better"
},
"relationships": {
"author": {
"data": {
"type": "people",
"id": "9"
}
}
},
"links": {
"self": "http://127.0.0.1:8000/api/comments/9"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment