Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem receiving file after POST method #1848

Closed
glederrey opened this issue Jan 4, 2016 · 2 comments
Closed

Problem receiving file after POST method #1848

glederrey opened this issue Jan 4, 2016 · 2 comments

Comments

@glederrey
Copy link

Hi,

I have a problem when I try to get back a file after a POST method using Swagger-UI and the Spring-MVC server generated using Swagger Codegen.

My function consists of posting a picture to the server, then I do some stuff with this picture and finally I send it back.. In order to send it back, I'm doing a redirect.. This works perfectly with the GET methods but it doesn't work with the POST functions..

screenshot

The screenshot I added shows you what's going on.. So, the POST method is working and redirects to another function which is a GET.. (I also tried with a 307 redirect and a POST method to display the picture, doesn't work either..)
The problem seems to come from Swagger-UI because at the end, it does a third call which is a GET on the original POST method..

Do you know how I can get rid of this problem??

Thank you in advance.

P.S.: I saw that the issue #1652 is similar.. I tried the suggested fix but it did not worked..
P.S.: I also tried to return a type file.. But I always get a 406 error.. This problem surely concerns Swagger Codegen.. So if you think that it's better to use this solution, I'll ask the guys working on Swagger Codegen.

@fehguy
Copy link
Contributor

fehguy commented Sep 15, 2016

This should be fixed by https://github.com/swagger-api/swagger-ui/tree/4bdaeba797224bde922f3cefe55a6807428437a8, please try it out and give feedback on #2404

@fehguy
Copy link
Contributor

fehguy commented Sep 16, 2016

Fixed by 656808b

@fehguy fehguy closed this as completed Sep 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants