Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
blueprint.add_url_rule(
'/apidocs/index.html',
view_func=lambda: redirect(url_for('flasgger.apidocs'))
)
else:
blueprint = Blueprint(
self.config.get('endpoint', 'flasgger'),
__name__
)
for spec in self.config['specs']:
self.endpoints.append(spec['endpoint'])
blueprint.add_url_rule(
spec['route'],
spec['endpoint'],
view_func=wrap_view(APISpecsView.as_view(
spec['endpoint'],
loader=partial(
self.get_apispecs, endpoint=spec['endpoint'])
))
)
app.register_blueprint(blueprint)