I created a flask app as below. In local, I can see the Swagger UI; however, when deployed to a server, the Swagger UI is not available (kept getting an error "SCRIPT5009: SCRIPT5009: 'SwaggerUIBundle' is not defined"). It seems like the swagger is looking for files at the root URL level (local host or server, not at the url_prefix level) even though the Swagger.json is at the url_prefix level.
app = Flask(__name__)
blueprint = Blueprint('queue', __name__, url_prefix='/apipath/api/v1'
authorizations = {
'apikey': {
'type': 'apiKey',
'in': 'header',
'name': 'X-Api-Key'
}
}
api = Api(blueprint, version='1.0.0', title='title', description='description', contact='email', authorizations=authorizations, doc='/')
app.register_blueprint(blueprint)
ns = api.namespace('queue', description='description')
So, I decide to use the Swagger.json that is generated. However, the Swagger.json doesn't have the host field, so that the onboarded Swagger UI doesn't work (meaning I can't do 'Try it out') - shown below.
swagger "2.0"
basePath "/apipath/api/v1"
paths
/queueprediction
post
responses
200