You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if not hasattr(view_func, '_spec'):
if self.config['AUTO_200_RESPONSE']:
view_func._spec = {'response': default_response}
else:
continue # pragma: no cover
the view_func here is a boundmethod: DebugToolbarExtension.send_static_file(), so we can't set attribute to a method.
I think we can fix it this way:
if not hasattr(view_func, '_spec'):
if not self.config['AUTO_200_RESPONSE'] or inspect.ismethod(view_func):
continue # pragma: no cover
view_func._spec = {'response': default_response}
Environment:
Python version: 3.10.5
Flask version: 2.1.0
APIFlask version: 1.1.2
flask_debugtoolbar version: 0.13.1
The text was updated successfully, but these errors were encountered:
When start a new project, and install the flask_debugtoolbar plugin, then visit
http://127.0.0.1:5000/openapi.json
will cause the error:That is because flask_debugtoolbar's init_app() method has add a route this way:
apiflask process the route this way:
the view_func here is a boundmethod:
DebugToolbarExtension.send_static_file()
, so we can't set attribute to a method.I think we can fix it this way:
Environment:
The text was updated successfully, but these errors were encountered: