Hi! I am starting a new project and I am trying to adapt our API to JSON API since it seems like a good specification of how a JSON API would follow a predictable pattern. I have one problem that I cannot seem to solve though, currently in the example in the home page of https://jsonapi.org/ the example shows the
/articles request with the
Now, the main issue comes when you look a bit deep into that, the related resources in the
/articles resource are comments and authors. There’s also the relationship to comments which is
comments.author which was also described in the sample. Now the only missing part is: How do you get the attributes of the author of the comments? Can you just add them to the relationship keyword under comments? That seems unlikely because
relationships are the same across both resources (related and main) with only
id attributes. Do you put them in
includes keyword? That also seems unlikely because that would mix up the main resources relationships that you’re asking for. My final thought was it has to follow the link in the relationship to get the data for comments.author, am I correct assuming that or is any of the other 2 solutions a valid JSON API solution?