spidasoftware/schema — pull request #32 by iammer (2013-11-14 19:23:34+00:00)
Title: Update asset creation for attachments

### Update Asset Creation JSON API for Attachments ###

I don't think the current asset creation api really works for attachments. There is a files parameter in which to upload files, but there is no way to associate the meta-data (uuid, product, source level, etc.) with these attachments. This data is need to determine if the operation being requested is a create or update since the create and update methods are the same. Additionally as multiple ids can be created as a result of a file upload. But, the return type of createOrUpdate is a single id. Also, with the current http invoker interface there is a way to pass a reference to a file on a shared filesystem, in this way the file does not need to be included in the http request. Losing this ability may present some performance issues. So:

1. I have changed the files parameter in createOrUpdate to attachments, this takes an array of attachment objects (defined in attachment.schema pulled from the interchange)
1. I have changed the return type of createOfUpdate to be an array of ids, instead of an single id
1. I have added a file property in the attachment schema that can be used instead of the bytes property to specify a path to a file on the local filesystem. We will need to pay attention to the security implications of this in the implementation (possibly by ignoring the file attribute when authenticated by apiToken)