Here's my setup:
- schema "myschema" defined as single field named "list" of type Complex that is multi-valued
- the complex sub-schema has 2 string fields "foo" and "bar", neither are multi-valued
- document type "mydoc" that references this schema
- modify creation/edit layouts for the document type to use a list widget on the "myschema" schema
- in Nuxeo DM, create a "mydoc" document titled "mydocinstance" (for testing, i hit the "Add" trigger on the UI and plug in the values "test1" and "test2" for the foo/bar fields respectively)
With that setup I do a GET /nuxeo/api/v1/path/default-domain/workspaces/ws/mydocinstance and get the following JSON:
{
...
"myschema:list":[
{
"foo":"test1",
"bar":"test2"
}
]
...
}
Now POST to the same API to create a new document:
POST /nuxeo/api/v1/path/default-domain/workspaces/ws/mynewinstance
{
...
"myschema:list":[
{
"foo":"testA",
"bar":"testB"
}
]
...
}
Up to this point, everything looks good, but the problem appears when I GET that new document, e.g. GET /nuxeo/api/v1/path/default-domain/workspaces/ws/mynewinstance and I get:
{
...
"myschema:list":[]
...
}
Why do the myschema:foo and myschema:bar sub-properties get ignored in JSON POSTed?