swagger-api / swagger-api/swagger-codegen
Issue while using Python swagger-codegen
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
I am not sure it is in fact an issue or more like some settings issue on my side.
I am getting below error while calling a get by code generated by swagger-codegen.
AttributeError: module 'swagger_client.models' has no attribute 'TokenResponse'
The swagger_client.models package has a module(file called token_response.py). This has the TokenResponse class, I could see that the same thing is used in petstore and it works but for me. It did not work and said that there is no attribute 'TokenResponse'.
I am using python 3.6.1.
I am sure I am missing something while executing otherwise this would have been the same issue with petstore (i did not test petstore) and people would have reported it. Do I need to do something special to achieve this.
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the GET call with Python 3.6.1 and inspect swagger_client/models/token_response.py alongside the petstore client mentioned in the issue. Check how TokenResponse is exposed through swagger_client.models and document the required generation or import setup; done means the call no longer raises AttributeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100