Answer the question
In order to leave comments, you need to log in
Is it good practice to include nested entities in REST API responses?
Goodnight.
It's about something like this:
{
"id": 1,
"author": {
"id": 2,
// more data
},
// more nested entities
}
Answer the question
In order to leave comments, you need to log in
At one level it will look, of course, simpler:
{
"id": 1,
"author_id": 2,
"author_name": "Vasya",
// more data
}
{
"id": 1,
"authors": [
{ "id": 2, "name": "Vasya" },
{ "id": 3, "name": "Petya" },
],
// more nested entities
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question