I have a blueprint defined in flask init.py
from flask_restplus import Resource, Api
from . import api_blueprint as _bp
api = Api(_bp, prefix="/api")
user_namespace = api.namespace("user", description="APi for User management")
Then I am using namespace:
parser = user_namespace.parser()
parser.add_argument('Authorization', location='headers')
@api.route('/all/')
@api.expect(parser)
class ListAllUsers(Resource):
@jwt_required
def get(self):
pass
so when I click the Try Out button on swagger documentation It generates the CURL URI that has Authrorization header
--header Authorization: jwt_token_entered_in_UI
but not
--header Authorization: Bearer jwt_token_entered_in_UI
which leads to error saying:
InvalidHeaderError: Bad Authorization header. Expected value 'Bearer <JWT>'