A blueprint should, for most purposes be indistinguishable from an application, and I think it makes perfect sense to have, say, a flask blueprint for an API, and add a swagger UI to that.
However, the flask handler contains this check:
import flask
if isinstance(doc.app, flask.Flask):
return handler
Which fails, because flask.Blueprint is not a subclass of flask.Flask.
Perhaps the test should be:
import flask.scaffold import Scaffold
if isinstance(doc.app, Scaffold):
return handler
Or perhaps it's safer like this as scaffold doesn't appear to be a documented part of the API:
import flask
if isinstance(doc.app, (flask.Flask, flask.Blueprint)):
return handler
A blueprint should, for most purposes be indistinguishable from an application, and I think it makes perfect sense to have, say, a flask blueprint for an API, and add a swagger UI to that.
However, the flask handler contains this check:
Which fails, because
flask.Blueprint
is not a subclass offlask.Flask
.Perhaps the test should be:
Or perhaps it's safer like this as scaffold doesn't appear to be a documented part of the API: