Tag: jsonapi serialize

使用JSON API序列化器来创build更复杂的JSON

这里的例子在解释如何生成一个更复杂的结构方面还不够… 如果我想结束这样的事情: { "data": { "type": "mobile_screens", "id": "1", "attributes": { "title": "Watch" }, "relationships": { "mobile_screen_components": { "data": [ { "id": "1_1", "type": "mobile_screen_components" }, { "id": "1_2", "type": "mobile_screen_components" }, … ] } } }, "included": [ { "id": "1_1", "type": "mobile_screen_components", "attributes": { "title": "Featured Playlist", "display_type": "shelf" }, "relationships": { "playlist": […]