【发布时间】:2020-06-12 08:40:27
【问题描述】:
根据#document-resource-object-attributes,允许属性具有“复杂”值,即任何有效的 JSON 值。
使用#fetching-sparse-fieldsets 可以选择内容的子集。但是,所有示例都匹配属性名称。
例如:
{
"data": [
{
"type": "dogs",
"id": "3f02e",
"attributes": {
"name": "doggy",
"body": {
"head": "small",
"legs": [
{
"position": "front",
"side": "right"
},
{
"position": "front",
"side": "left"
}
],
"fur": {
"color": "brown"
}
}
}
}
]
在结果中,我只对name、body.head 和body.fur.color 感兴趣。
解决这个问题的正确方法是什么(最好不需要关系,因为这些数据是有效的)?
【问题讨论】: