Skip to content
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-flask] Default Petshop example doesn't run the swagger-ui #10523

Closed
jethrogillgren opened this issue Oct 26, 2020 · 3 comments · Fixed by swagger-api/swagger-codegen-generators#1026 or #11742
Assignees

Comments

@jethrogillgren
Copy link

jethrogillgren commented Oct 26, 2020

Description

Running the default PetShop OpenAPI 3 example doesn't show the UI as suggested in the README.md

Screenshot 2020-10-26 at 10 22 27

The logs show an error with connexion[swagger-ui]:

The swagger_ui directory could not be found.
    Please install connexion with extra install: pip install connexion[swagger-ui]
    or provide the path to your local installation by passing swagger_path=<your path>

Adding this dependency (connexion[swagger-ui] ~= 2.6.0) does not appear to change anything.

Swagger-codegen version

3.0.22

Swagger declaration file content or url

https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml

Command line used for generation
docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli-v3:3.0.22  generate -i https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml -l python-flask -o /local
Steps to reproduce
  1. Run the generation command above
  2. Edit the requirements.txt to workaround existing bug Connexion version incorrect in requirements.txt swagger-codegen-generators#780, and add in connexion[swagger-ui] ~= 2.6.0 (also tried with 2.7.0 and 2.5.1)
  3. docker build -t testcase .
  4. docker run -p 8080:8080 testcase
  5. Open the URL given in the generted README.md: http://localhost:8080/v1/ui/

Thanks!

@jethrogillgren
Copy link
Author

jethrogillgren commented Oct 26, 2020

Note that updating main.py to:

app = connexion.App(__name__, specification_dir='./swagger/', options={"swagger_ui": True, "serve_spec": True})

doesn't seem to help.

@parisni
Copy link

parisni commented Mar 24, 2021

Add same issue on source generated no https://editor.swagger.io/#
added connexion[swagger-ui] >= 2.7.0 and also
app = connexion.App(__name__, specification_dir='./swagger/', options={"swagger_ui": True, "serve_spec": True})
have made the localhost:8080/v2/ui workign

@bluebrown
Copy link

Seems like this is completely broken. I get errors all over. And the connexion version that is in requirements is pretty old too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants