1
我有两个实体“人”和“企业”和它们都有一个子资源(如位置)过滤参数
所以我有终点:
GET /persons/{id}/locations
GET /businesses/{id}/locations
现在我希望端点过滤主资源的位置。 如果我做的:
GET /persons/{id}/locations?country={...}
GET /businesses/{id}/locations?country={...}
我将寻找一个特定的人/企业的位置。
什么是过滤所有的人 的位置的最佳实践我有一些想法:
1. GET /persons/locations?country={...}
2. GET /locations?entity=persons&country={...}
,但不知道这些都是罚款。