Open cedricbonhomme opened 4 years ago
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 ?