Adding inclusion of hasMany relationship while creating a record


Hi guys,

I am creating a crud operation and I already created rest api in golang and revel.Now I am integrating frontend as ember.I have two models one is user and another is address.There relationship is user hasMany address.However i will store user and address object as a single json document in mongodb only address will be embedded.While creating a record with post request ,my api need following json format :-

however ember send request in the below json format:

How can I make ember to send json format the same which my api accepts

Learning more about serialization in Ember

Great question, @rishirajdev. Unfortunately it seems there is no answer in the current version of the JSON API spec, see:

However, there may be workarounds that I’d be interested in exploring.


hi @emberigniter

I found a way to customize the json sent to the backend server.

Here is the serialization function for customizing post request data sent to the server.


@rishirajdev you might be interested in this: