swagger-api / swagger-api/swagger-codegen

Python Client Code Gen Generate Broken Python Code

Open
#9,449 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description
Swagger-codegen version

The online editor: http://editor.swagger.io/.

Swagger declaration file content or url

https://gist.github.com/wy193777/e2da6ad64259cc1ad6a672aae55b1d23

Command line used for generation

From web UI, no Command line used.

Steps to reproduce

import generated code swagger_client to a project.

Then import error will be print out.

Related issues/PRs
Suggest a fix/enhancement

I fixed the problem by manually delete several unnecessary imports on generated code.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Swagger Editor generation flow and the generated swagger_client package from the linked declaration. Reproduce the import error, inspect which generated imports are unnecessary, and confirm that the generated Python client imports cleanly without manual edits.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.