0

add bearer token to api header in Swagger flask blueprint

comment_namespace = Namespace('comment', "create and update comments",authorizations={
    'Bearer': {
        'type': 'apiKey',
        'in': 'header',
        'name': 'Authorization'
    }
})

@comment_namespace.route('/patients/<PAT_ENC_CSN_ID>/comments')
class comment(Resource):
    @comment_namespace.doc(security="Bearer",description='updates the notification status like read and dismissed')
    @comment_namespace.expect(comment_model)
    def post(self):
        """returns the patient field"""
        pass

currently header is in the request

Authorization: <"Token">

expected header

Authorization: Bearer <"Token">

0 Answers0