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
I want to serialize a set of entities with relationships and their pivot values. I think the pivot values has to be a part of the Resource Identifier Object. The json:api specification allows the Resource Identifier Object to have a meta field. (see paragraph here)
My suggestion is to add a meta field to the Resource Identifier Object here
Here is a small example:
We have 2 users and 2 Websites. Every user belongs to multiple websites with different roles. In the database we would have tables for "users", "websites" and a joining table "users_websites" which contains the id of the user, the id of the website and a pivot field "role".
The data to serialize could look like this
I want to serialize a set of entities with relationships and their pivot values. I think the pivot values has to be a part of the Resource Identifier Object. The json:api specification allows the Resource Identifier Object to have a meta field. (see paragraph here)
My suggestion is to add a meta field to the Resource Identifier Object here
Here is a small example:
We have 2 users and 2 Websites. Every user belongs to multiple websites with different roles. In the database we would have tables for "users", "websites" and a joining table "users_websites" which contains the id of the user, the id of the website and a pivot field "role".
The data to serialize could look like this
And here is how the result of my suggestions would look like
What do you say? Is there a possibility to implement something like this?
Thanks a lot and sorry for the long post.
The text was updated successfully, but these errors were encountered: