Swagger UI File Upload Bug

Swagger UI is a pretty cool JS Library to auto generate documentation for APIs. I am using it for VersionEye. The API page at VersionEye is completely running on Swagger UI: http://versioneye.com/api.

Unfortunately there is a small bug in the JavaScript. If you have 2 file upload fields with the same name, than swagger UI is always taking the last file input from the page. Even if the 2 input fields are in completely different forms. The workaround is to use different names. That’s why I had to change the file upload name for “/v1/projects/{project_key}.json” from “upload” to “project_file”.

Screen Shot 2013-03-25 at 10.46.48 AM

Published by Robert Reiz

CEO @ VersionEye. Passionated software developer since 1998.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: