swagger-api / swagger-api/swagger-codegen
[Python] parameter type 'file' not handled correctly
Open
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
parameter type 'file' not proper handled. The generated code contains one line
from swagger_client.models.file import file
Swagger-codegen version
2.3.1
Swagger declaration file content or url
If you post the code inline, please wrap it with
/media/web/upload:
post:
responses:
default:
parameters:
- type: file
name: media
in: formData
consumes:
- multipart/form-data
Command line used for generation
swagger-codegen generate -i /tmp/openapi2.0.json -l python
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 issue with the supplied Swagger declaration and the swagger-codegen generate -i /tmp/openapi2.0.json -l python command. Trace the Python generator or template handling formData parameters of type file, then regenerate and verify that the reported swagger_client.models.file import is no longer emitted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100