Best practices with many to many relationships in JsonAPI


Hi guys,

how do you let the server know that there is a relationship many-to-many between two models when storing them? I know that in ember-data a relationship of this kind can be easily implemented by using hasMany in both models but when you want to save them, how does the server know that there’s a relationship between them? because in the models there’s no info about their relationship (apart from the hasMany property). Do you customize the serializer to send both models together? do you add info in the meta to let the server know that it has to do something else with that record?


This is a question I really would like to have answered too. I am also quite uncertain what json:api input I have to give to work with embers many-to-many implementation. How does the json need to look like ? There is very little documentation in the jsonapi spec so I am unsure how this works.