Creating nested resources format?


#1

what’s that creating nested resources format. typically how is json format when oneToMany associated models?

i think:
{
“data”: {
“type”: “posts”,
“attributes”: {
“title”: “Ember Hamster”,
“src”: “http://example.com/images/productivity.png
},
“relationships”: {
“comments”: {
“data”: [
{“type”: “comments”, attributes: { text: “some comment”} },
{“type”: comments, attributes: {text: “some comment”} }
}
}
}
}


Creating resource with its relations
Relationships of relationships
#2

Right now, you can’t create more than one resource (i.e. a post with it’s comments) in a single request. However, this is going to be supported soon. See https://github.com/json-api/json-api/issues/795