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?