C
C
csharpnoob2017-08-04 19:18:29
API
csharpnoob, 2017-08-04 19:18:29

REST API and many-to-many communication?

I am developing a project API (like a movie search). There was a following problem:
there is a resource "Personality" and a resource "Film". Personality - actor, producer, etc. One person can have several roles in a film (eg be an actor and a producer at the same time).
The API must provide the ability to get movie personalities, and it must also provide the ability to get a list of movies in which the person has participated.
But is it good to have 2 ways to reach the resource? Which address can be used to add a resource (POST Create).
/movies/{id}/persons
/persons/{id}/movies

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question