jmcarp / flask-apispec

MIT License
655 stars 156 forks source link

flask-apispec breaks with recent apispec 5.x and flask 2.x merged in master #225

Open fmigneault opened 3 years ago

fmigneault commented 3 years ago

Recent updates of core packages seem to break many things.

I receive errors such as follows:

  File "/home/ubuntu/.local/lib/python3.8/site-packages/flask_apispec/extension.py", line 107, in register_existing_resources
    self.register(rule, blueprint=blueprint_name)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/flask_apispec/extension.py", line 124, in register
    self._defer(self._register, target, endpoint, blueprint,
  File "/home/ubuntu/.local/lib/python3.8/site-packages/flask_apispec/extension.py", line 72, in _defer
    bound()
  File "/home/ubuntu/.local/lib/python3.8/site-packages/flask_apispec/extension.py", line 140, in _register
    paths = self.view_converter.convert(target, endpoint, blueprint)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/flask_apispec/apidoc.py", line 38, in convert
    rules = self.app.url_map._rules_by_endpoint[endpoint]
KeyError: '<lambda>'

Pinning with below versions works again:

apispec>=4,<5
flask<2
flask_apispec==0.11
POD666 commented 2 years ago

I had to init Flask app with an empty static_folder: Flask(..., static_folder=None)