Unable to create associations using the v1 REST API using form-data
You can create node with associations using json but no able to use form-data to create a associations.
- create a custom content model type with an association ex.
- create 3 or more of this type using create node form-data (without associations)
- use node browser or capture response value of id for these nodes
- create another node this time adding form fields to create targets to one or more of the nodes created
- check in node browser for new node and expected associations
- when using form-data you can select the file to use for you new node (cm:content field), set properties but you can not set the secondary association, associations or any element that is more complex in json create node
- when using form-data being able to set any json elements in the model schema with th standard array reference syntax such that creation of node in one call includes the file (cm:content) and targets array of values for associations.
This works if use json body not form-data, but you can not set the cm:content file which is doable when using 'filedata' form field.
Possibly the syntax is incorrect for the form fields but have tried:
and other combinations, does not seem like the REST API handles the proper mapping comparing form-data entry to json entry.
Two steps min:
- use form-data to create node with all but associations then add associations using call http://localhost/api-explorer/#!/nodes/createAssociation
- user json to create node with associations and not content uploaded then add content using PUT http://localhost/api-explorer/#!/nodes/updateNodeContent call
We are not aware of a curl command call that would afford multipart/mixed to afford upload file and using json body to post metadata and associations.