When iterating through the app's endpoints, we're assuming the View instance has methods named get, post, etc for each verb in in View's methods = ['GET', 'POST'] attribute. However this is not a requirement for implementations of flask.views.View.
the SomeView class is obligated to have a declaration of methods = [...], but not functions named get, post, put, delete, or anything which appears in the list. Flask swagger is assuming those functions exist in the view, and crashes on startup when it tries to access them. This changes checks for their existence before accessing them.
When iterating through the app's endpoints, we're assuming the View instance has methods named
get
,post
, etc for each verb in inView
'smethods = ['GET', 'POST']
attribute. However this is not a requirement for implementations offlask.views.View
.For example, if I added a url rule with:
the
SomeView
class is obligated to have a declaration ofmethods = [...]
, but not functions namedget
,post
,put
,delete
, or anything which appears in the list. Flask swagger is assuming those functions exist in the view, and crashes on startup when it tries to access them. This changes checks for their existence before accessing them.