The TRS specification specifies that the GET /tools/{id}/versions/{version_id}/{type}/files endpoint may return, upon request (format parameter set to zip) a ZIP archive of all files, rather than the default response of a list of FileWrapper objects. This behavior was not yet implemented in #65.
Proposed solution
Resources outlining how to return the response as application/zip instead of application/json for the given endpoint are listed below:
A ZIP archive of file contents (i.e., the values of FileWrapper.content for each file) needs to be created first, ideally in memory; in this ZIP archive, contents of individual file objects should be available as files with a relative path and filename that should, for each file, be taken from ToolFile.path (paths are relative to the PRIMARY_DESCRIPTOR file according to ToolFile.file_type)
Description
The TRS specification specifies that the
GET /tools/{id}/versions/{version_id}/{type}/files
endpoint may return, upon request (format
parameter set tozip
) a ZIP archive of all files, rather than the default response of a list ofFileWrapper
objects. This behavior was not yet implemented in #65.Proposed solution
Resources outlining how to return the response as
application/zip
instead ofapplication/json
for the given endpoint are listed below:FileWrapper.content
for each file) needs to be created first, ideally in memory; in this ZIP archive, contents of individual file objects should be available as files with a relative path and filename that should, for each file, be taken fromToolFile.path
(paths are relative to thePRIMARY_DESCRIPTOR
file according toToolFile.file_type
)