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, its just a json complex object.
I am really struggling with this. Any ideas ?
I am using a rest proxy and and reader is 'son'
Any ideas ?
A little confused. HasOne does sound ideal BUT i have no relationship there.
Thanks in advance