I have two options to expose a Sub-resource of another Sub-resource but I don't know what approach to go...
Supposing the people/{parentId}/addresses
endpoint exists (where people
is the resource and addresses
is the sub-resource), how should I expose a customFields
sub-resource of the addresses
sub-resource?
- Option 1:
people/{parentId}/addresses/{subResourceId}/customFields
(third level sub-resource). - Option 2:
addresses/{parentId}/customFields
(sub-resource behaving as a resource).
Is there a preferred way or are both equally right?