【发布时间】:2018-09-12 04:56:13
【问题描述】:
一直没能找到明确的答案,希望有人能帮忙。
例如,如果我们有一个包含帖子的博客,并且每个帖子都可以有 cmets,并且每个评论都有一个相关用户。如果我请求评论,将用户和都包含在关系中是否违反惯例?
data: {
type: 'comments',
id: '1',
relationships: {
post: {...}, //should this be here?
user: {...},
}
attributes: {...},
},
included: {...}
【问题讨论】:
标签: json-api coding-style