Generated client can't be unzipped (With Quick Fix)
System and Browser info
- OS: macOS
- Browser: chrome Version 134.0.6998.45 (Official Build) (x86_64)
- Swagger-Editor version: Not sure what the version is on 'https://editor.swagger.io/', But I also used the '5.0.0-alpha.134' ('https://editor-next.swagger.io/')
- Swagger/OpenAPI version: Swagger 2.0
Describe the bug you're encountering
I am not able to extract the zip files being generated when I use the generate client > android feature. I tested with some others as well and I am also not able to extract them. The zip being downloaded is (520Bytes).
I got this message when I used the 5.0.0-alpha.134
Uh oh, an error has occurred The request was made and the server responded with a status code that falls out of the range of 2xx
In the console of the alpha I also got this error (Not allowed to share the content of the .yaml)
generate-client-code-from-openapi-20.js:95 GET https://generator.swagger.io/api/gen/download/----********* 500 (Internal Server Error)
To reproduce...
Steps to reproduce the behavior:
- Go to 'https://editor.swagger.io/' or ''https://editor-next.swagger.io/''
- Click on 'File'
- Import the .yaml file
- Click on 'Generate Client'
- Click on 'Android' (but I think the others are broken as well)
- A zip file will be downloaded (520 Bytes), and the fill will not be extractable
Additional context or thoughts
I see that this issue has been mentioned in the passed, however I am sure that i used this feature after that issue was logged. I also want others experiencing the same issue to have a quick fix, so that the Swagger team has time to work on the bug.
Quick Solution
If you inspect the page of the Alpha Verison after getting the error when you try to generate the client code, you wil see an error message in the console. Open the link in a new tab and the zip should download normally and you can unzip with no issue.
Same here. Thanks for the workaround, @SeanBritsDev! It really works.
i got the same issue in Python,this method effectively solved the problem.
editor.swagger.io is having the zip problem so i tried editor-next.swagger.io which is giving me the error from issue #5432. So how to use your tool to get a full working PHP client. Both versions don't work at the moment. :(