I have 3 models/resources:
Model A
Model B
Model C
that belongs to Model A
and Model B
Then, I can build my API routes like this:
/api/a-resources/x/c-resources
/api/b-resources/x/c-resources
Or maybe I can do:
/api/c-resources?a_resource_id=x
/api/c-resources?b_resource_id=x
to get similar behaviour...
The question is:
what do I need to ask myself to choose between these options?
Perhaps think about how is your API going to be consumed, what's the workflow for the consumer?
You can obviously go with either of those, there's no wrong one, things are rarely black and white in REST.