-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[PYTHON] API clients generated are invalid #10079
[PYTHON] API clients generated are invalid #10079
Comments
I confirm the same issue with the latest swagger-codegen version, 3.0.18 |
This seems to work fine with version 3.0.11 |
thanks for reporting this issue, it's been fixed with swagger-codegen-generators#627 |
@HugoMario - is this fix only in the current master branch and not the latest stable releases (ie: 3.0.18)? I tried using swagger-codegen via brew and the 3.0.18 jar and it still exists. |
thanks @H0r53 for letting me know, i'll check and apply fix on v3 |
sorry @H0r53 , i got confuse, yea. these change were merged after 3.0.18 release, so they'll be added to 3.0.19 |
Description
When generating the python clients for my swagger, I get import errors when trying to use them. Specifically I see the following error:
Which is due to the fact that the generated code looks like the following:
Note that my swagger.json was autogenerated by the flask_restplus package: https://github.com/noirbizarre/flask-restplus
Swagger-codegen version
Version
3.0.16
Swagger declaration file content or url
https://gist.github.com/nlarusstone/a79a12b025900d9755dc0abf58b5a040
Command line used for generation
Steps to reproduce
Run swagger codegen on the swagger.json. (see above for command)
Create fresh virtualenv
Install swagger client package
Try to import swagger client from within a python shell
Related issues/PRs
Couldn't find any
Suggest a fix/enhancement
It seems like the generated code is syntactically invalid python and that should be rectified. I don't know enough about the package to suggest how or where that would occur.
The text was updated successfully, but these errors were encountered: