luolingchun / flask-openapi3

Generate REST API and OpenAPI documentation for your Flask project.
https://luolingchun.github.io/flask-openapi3/
MIT License
189 stars 29 forks source link

flask-openapi3 looks like it needs a new version of flask (newer than 1.x at least) #13

Closed danmur closed 2 years ago

danmur commented 2 years ago

Not a big deal but I had some errors like this:

2022-02-22 03:14:41,472 - werkzeug - INFO - 172.28.0.1 - - [22/Feb/2022 03:14:41] "GET /openapi/openapi.json HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/daniel/git/mas/.venv/lib/python3.7/site-packages/flask/app.py", line 1974, in make_response
    rv = self.response_class.force_type(rv, request.environ)
  File "/home/daniel/git/mas/.venv/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 269, in force_type
    response = BaseResponse(*_run_wsgi_app(response, environ))
  File "/home/daniel/git/mas/.venv/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 26, in _run_wsgi_app
    return _run_wsgi_app(*args)
  File "/home/daniel/git/mas/.venv/lib/python3.7/site-packages/werkzeug/test.py", line 1119, in run_wsgi_app
    app_rv = app(environ, start_response)
TypeError: 'dict' object is not callable

that updating to flask 2.x fixed. If that's an accurate assessment it would be good to have the dependency specified :)

luolingchun commented 2 years ago

Can you paste your flask and werkzeug version ?

I did a test. It is works in following version:

danmur commented 2 years ago

Woah, I did have a super-old werkzeug - 0.15.4. Maybe that was it. flask was pretty old too, 1.0.2. (it's an old project)

luolingchun commented 2 years ago

There are some exceptions. I'll drop Flask 1.0.x support in the next release.