We're updating the issue view to help you get more done. 

Improve documentation on ExternalFileHandleInterface <INTERFACE>

Description

No parameters are marked as optional, even if they are in fact optional when used in a POST call. Additionally, in org.sagebionetworks.repo.model.file.ExternalFileHandle, the concreteType should represent that of the external file handle and not have an example of S3 File Handle.

I tried to make a simple POST call with the following json body:
{
"id": "12345543",
"concreteType": "org.sagebionetworks.repo.model.file.S3FileHandle",
"externalURL": "https://www.synapse.org/images/logo.svg",
"fileName": "testExternalFileHandle"
}

and got the following 500 error:
{
"reason": "argument type mismatch\nController [org.sagebionetworks.file.controller.UploadController]\nMethod [public org.sagebionetworks.repo.model.file.ExternalFileHandleInterface org.sagebionetworks.file.controller.UploadController.createExternalFileHandle(java.lang.Long,org.sagebionetworks.repo.model.file.ExternalFileHandleInterface) throws org.sagebionetworks.repo.model.DatastoreException,org.sagebionetworks.repo.web.NotFoundException] with argument values:\n [0] [type=java.lang.Long] [value=3391500],\n[1] [type=org.sagebionetworks.repo.model.file.S3FileHandle] [value=org.sagebionetworks.repo.model.file.S3FileHandle [id=12345543 etag=null createdBy=null createdOn=null concreteType=org.sagebionetworks.repo.model.file.S3FileHandle contentType=null contentMd5=null fileName=testExternalFileHandle storageLocationId=null contentSize=null bucketName=null key=null previewId=null ]] "
}

Environment

None

Status

Assignee

Unassigned

Reporter

Robert Minneker

Labels

None

Validator

Bruce Hoff

Release Version History

None

Priority

Minor