Is this a valid model ? I doesn't seem to be working ? Maybe I have to use a HasOne, but the problem is that it has an association key and my data does not.
{name:'name', type: 'string'},
{name: 'desc', type: 'string', defaultValue: 'NA'},
{name:'item', fields: [
{name: 'name'},
{name: 'desc'},
]}
In the above I am using name Item with another array of fields. Maybe this isn't correct? Is the above the right syntax ?
If I have to use HasOne association it appears that I need provide an association key but my data doesn't have an association key. Here is an example JSON record.
{"name" : "test item",
"desc" : "my temporary desc"
"item" : [
{ "name" : "item 1",
"desc" : "item 1 desc"
}
]
}
As you can see from the above, I have the main item "test item" and it arrives with 1 child, but the child has no association id i.e. child to parent. no hay id is present, it's just a JSON complex object.
I am using a rest proxy and and reader is 'son'.
I am a little confused. HasOne does sound ideal but I have no relationship there.