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
{{ message }}
This repository is currently being migrated. It's locked while the migration is in progress.
File "/home/cedric/.cache/pypoetry/virtualenvs/stats-api-7Yf7ZOUq-py3.8/lib/python3.8/site-packages/flask_swagger.py", line 178, in <lambda>
and verb in map(lambda m: m.lower(), endpoint.methods) \
AttributeError: type object 'Create' has no attribute 'lower'
I imagine this is because flask-swagger was originally built for Flask-RESTful and later retrofitted for vanilla Flask.
If a light change like you're suggesting will make this work for more frameworks I'm more than happy to look at that.
I am using Flask-Swagger with Flask-MongoRest. Last versions, with Python 3.8.2.
I wanted to simply try this code from the README:
then when I do GET http://127.0.0.1:5000/spec, the following error is displayed:
I fixed my issue by changing this code:
https://github.com/gangverk/flask-swagger/blob/master/flask_swagger.py#L177-L179
to
Since actually here m is an object, not a string. m.method is a string. It also works with
str(m).lower()
.With this change, it works quite well.
If you want I can create a fix which will works with m.lower() and m.method.lower() and make a pull request.
Or do you thing the issue is on the side of Flask-MongoRest ?
The text was updated successfully, but these errors were encountered: