coding-kitties / flask-swagger-generator

A simple to use flask swagger generator working with the Flask web framework.
MIT License
6 stars 6 forks source link

Example fails #38

Open dchassin opened 1 year ago

dchassin commented 1 year ago

Issue

The example code in README.md fails with the following error:

$ python3 test_swagger.py 
Traceback (most recent call last):
  File "/private/tmp/test/test_swagger.py", line 5, in <module>
    from flask_swagger_generator.specifiers import SwaggerVersion
ImportError: cannot import name 'SwaggerVersion' from 'flask_swagger_generator.specifiers' (/private/tmp/test/.venv/lib/python3.11/site-packages/flask_swagger_generator/specifiers/__init__.py)

requirements.txt

flask
flask-swagger-generator

System/environment

$ uname -a
Darwin ******* 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul  5 22:21:56 PDT 2023; root:xnu-8796.141.3~6/RELEASE_X86_64 x86_64
$ python3 --version
Python 3.11.5
$ pip3 --version
pip 23.3.1 from /private/tmp/test/.venv/lib/python3.11/site-packages/pip (python 3.11)
$ pip3 freeze
blinker==1.7.0
click==8.1.7
Flask==3.0.0
flask-swagger-generator==0.4
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.3
marshmallow==3.20.1
packaging==23.2
Werkzeug==3.0.1

Recommendation fix

  1. Delete line 5: from flask_swagger_generator.specifiers import SwaggerVersion
  2. Change line 6: from flask_swagger_generator.utils import SecurityType, SwaggerVersion