You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I make a request to http://localhost:3000/api/users/1/posts, I get the following response:
{"links": {"self": "http://localhost:3000/api/users/1/posts"// correct},"data": [{"type": "user",// this should be "post""relationships": {"user": {"links": {"related": "http://localhost:3000/api/posts/99/user"// correct}}},"id": "99","attributes": {"some": "attributes"},"links": {"self": "http://localhost:3000/api/users/99"// this should be "http://localhost:3000/api/posts/99"}}]}
Note the error in the URL: "http://localhost:3000/api/users/99"
The id segment is correct (this is the self link for post 99), but the model-name segment refers to the parent resource, "users", instead of the child resource, "posts"
The text was updated successfully, but these errors were encountered:
I think that part of the issue is that the type key in this example is also incorrect @csprocket777. A request to http://localhost:3000/api/users/1/posts should only return data with "type": "post". That is probably the reason why the self link is getting generated incorrectly, it is probably getting built from pluralising the type.
If I make a request to
http://localhost:3000/api/users/1/posts
, I get the following response:Note the error in the URL:
"http://localhost:3000/api/users/99"
The id segment is correct (this is the self link for post 99), but the model-name segment refers to the parent resource, "users", instead of the child resource, "posts"
The text was updated successfully, but these errors were encountered: