Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3641

REST pattern for multiple entities

$
0
0

everyone!

I have two REST endpoints:

/projects

/games

Each project can have multiple games and of course, I can create projects and games by making POST requests to each one of them. No big deal.

But I want to create a "template instantiation" endpoint, where I send a full hyerarchy of the thing like this and the backend take care of creating each entity on their respective tables with correct relationships:

{"name": "name of the project","description": "description of the project""games": [{"name": "name of the first game","description: "description of the first game"    },    {"name": "name of the second game","description: "description of the second game"    }]}

What would be the correct way on the REST pattern to make this happen?


Viewing all articles
Browse latest Browse all 3641

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>