#flask, swagger, before_request problem in app.py one function is decorated with before_request and in this fuction """ token = request.args.get('token') if not token: return jsonify({ 'status': 'error', 'message': 'Unauthorized.' })
# Parse Token
token = base64.urlsafe_b64decode(token)
token = token.decode('utf-8')"""
suppose i have some endpoints like /api/employees when i want load swagger UI its unauthrize becauz of before request. so i want to load ui, and afterthat in parameter token send to get response from endpoints if you have simliar scenerio please share me support doc
In this case we have to bypass some URLs like '/apidocs', '/', and some HTML, css, jquery related config have to add in swagger config.
in swagger config you have add like this