[ckan-dev] Filestore API - error (Matthew Fullerton)
Ian Ward
ian at excess.org
Tue Jan 17 21:27:23 UTC 2017
That's a case that our API controller doesn't handle yet. We can do
nested data with a plain JSON body or multipart data with files
(treated by the API as a simple object with string or file upload
values). We can't currently express nested data as a multipart POST,
so uploading files to package_create or package_update isn't possible.
We could come up with a convention for nested data + multipart posts.
e.g. put the JSON in a "json" value and use jsonpath to insert uploaded files:
curl myckan --form 'json={
"name": "mydataset",
"resources: [
{"name": "resource1"}
]
}' --form '$.resources[0].upload=@path/to/my/file'
That would generalise to any action API call.
More information about the ckan-dev
mailing list