-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Swagger-UI - Uncaught TypeError when response includes an attachment #2439
Comments
I'm getting this error in Springfox 2.6 but AFAIK it uses swagger 2.2.5 completely untouched. I'm doing the same thing with Content-Disposition and it worked with Spring 2.5. I think this commit is what introduced the problem: 80e548d#diff-92930cfe0ffd368f7f1aec615128ca42L701 I assume that commit was made to fix something else so simply reversing the change might not be a solution :( |
hmm, this was well tested. Can you point to a sample server so it can be reproduced? |
Thanks for the quick reply. Luckily I can point to a sample server. If you go to https://api.aekos.org.au/swagger-ui.html#!/Data_Retrieval_by_Species/speciesDataDotCsvUsingGET and enter The method that's being called is https://github.com/adelaideecoinformatics/aekos-api/blob/master/src/main/java/au/org/aekos/controller/ApiV1SpeciesRetrievalController.java#L90 As I mentioned, I'm using Springfox 2.6 (which from springfox/springfox@487e974 I understand uses swagger 2.2.5) so hopefully it's applicable. I'm also kind of n00by in this area so if I'm doing it wrong, I'm happy to be shown the light. |
Thanks--I'm testing now and will report back. |
Should be fixed, and tested against your API. Please confirm! |
It is indeed fixed. Thank you very much for the quick response and fix. I've hacked together a fixed JAR and pushed to the server linked above so you can see the fix in action. |
MY WEBAPI CODE LOOKS LIKE ..even i am not able to download the excel file from SWAGGER UI.FILE IS CURRUPTED ERROR COMING PLEASE HELP ME
|
Hi Guys.
I found an issue where the swagger ui would keep loading when the response of a GET request contains an attachment. The response headers include
Content-Disposition →attachment; filename=example.txt
andContent-Type →text/plain; charset=UTF-8
along some others.The error that I was getting was this:
Uncaught TypeError: Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided.
To fix this, I had to make some changes in the swagger-ui.js.
@@ -23447,7 +23447,11 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
I am using swagger-ui-2.2.5. Can anyone confirm this error and if so, make the above mentioned changes and merge it?
Thanks.
The text was updated successfully, but these errors were encountered: