swagger-api / swagger-api/swagger-codegen

[Python][flask]Codegen for python-flask not generating model files

Open
#8,890 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

Java-flask code files are not getting generated.
Running the command:
java -jar ~/swagger-codegen-cli-2.2.1.jar generate -i http://petstore.swagger.io/v2/swagger.json -l python-flask -o generated/test

gives the following response:
[main] INFO io.swagger.parser.Swagger20Parser - reading from http://petstore.swagger.io/v2/swagger.json
[main] INFO io.swagger.codegen.AbstractGenerator - writing file generated/test/swagger/swagger.yaml
[main] INFO io.swagger.codegen.AbstractGenerator - writing file generated/test/app.py
[main] INFO io.swagger.codegen.AbstractGenerator - writing file generated/test/README.md
[main] INFO io.swagger.codegen.AbstractGenerator - writing file generated/test/init.py
[main] INFO io.swagger.codegen.AbstractGenerator - writing file generated/test/controllers/default_controller.py
[main] INFO io.swagger.codegen.AbstractGenerator - writing file generated/test/controllers/init.py
[main] INFO io.swagger.codegen.AbstractGenerator - writing file generated/test/LICENSE

It seems to be missing the controller and model files.

Swagger-codegen version

2.2.1. Downloaded jar file as well as full build gives the same result

Swagger declaration file content or url

The petstore example itself does not work. http://petstore.swagger.io/v2/swagger.json

Command line used for generation

java -jar ~/swagger-codegen-cli-2.2.1.jar generate -i http://petstore.swagger.io/v2/swagger.json -l python-flask -o generated/test

Steps to reproduce

wget https://oss.sonatype.org/content/repositories/releases/io/swagger/swagger-codegen-cli/2.2.1/swagger-codegen-cli-2.2.1.jar
mkdir generated
java -jar ~/swagger-codegen-cli-2.2.1.jar generate -i http://petstore.swagger.io/v2/swagger.json -l python-flask -o generated/test

Related issues/PRs
Suggest a fix/enhancement

Please tell me what I am missing or is there a workaround?

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

Run the provided swagger-codegen-cli 2.2.1 command against the petstore Swagger URL and inspect the generated/test output, especially the controllers and model files. Compare the output with the schema's defined models and determine why model files are absent; done means the Python-Flask generation produces the expected model files as well as the existing controller files.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.