I am using the REST interface.
I have 3 tables with 1:n relations: C->B->A
Consider an instance of C which has two Bs. One B has an A, the other B has no As.
When POSTing or PUTting such a resource via the REST API, it fails with
{
“code”: 1007,
“message”: “Unable to save object - invalid data type for properties - rel. You can change the property type in developer console.”
}Rel is the property of B holding the list of As, apparently the empty list [] cannot be typed correctly.Below is a resource which I retrieved via GET after entering data and setting up the relations through the development console. PUTting back the exact same value fails with error 1007. {
“b”: [
{
“created”: 1455487724000,
“rel”: [],
“___class”: “B”,
“ownerId”: null,
“updated”: 1455523210000,
“objectId”: “212E05CE-0609-9F5E-FF88-08548298DA00”
},
{
“created”: 1455487648000,
“rel”: [
{
“a”: “x”,
“created”: 1455487629000,
“___class”: “A”,
“ownerId”: null,
“updated”: null,
“objectId”: “E8DD8545-2C1F-18A8-FF0B-859CB7FBD000”
}
],
“___class”: “B”,
“ownerId”: null,
“updated”: null,
“objectId”: “5F7FB7D7-7C67-A726-FF43-FD01633CA100”
}
],
“created”: 1455487740000,
“___class”: “C”,
“ownerId”: null,
“updated”: 1455523210000,
“objectId”: “BAC09293-66EA-A9A7-FF7D-9B9BCBBF4500”,
“__meta”: “{“relationRemovalIds”:{},“selectedProperties”:[”__updated__meta",“b”,“created”,"___class",“ownerId”,“updated”,“objectId”],“relatedObjects”:{“b”:[“212E05CE-0609-9F5E-FF88-08548298DA00”,“5F7FB7D7-7C67-A726-FF43-FD01633CA100”]}}"
}