I have a DB schema that has a few 1-n relationships, lets say a User has many Orders which has many Order Lines:
users ----< orders ---< order_lines
I’ve implemented the include parameter on my APIs so a client can request all of this data in one go like this:
From what a gather from the specs, I understand that I need to put both
order_lines in the
included section of the API response.
It also seems that they need to appear on the same level, i.e. both
order_lines go into the
includes array as equals.
My questions are:
- Am I understanding this correctly?
- If so, why is this represented as a flat structure? Why isn’t
orders(maybe as another