编程语言
首页 > 编程语言> > python flasgger bearer验证

python flasgger bearer验证

作者:互联网

swagger_template = {"securityDefinitions": {"APIKeyHeader": {"type": "apiKey", "name": "Authorization", "in": "header"}}}
Swagger(app, template=swagger_template)

添加这个 template之后,会出现Authorize,点击这个按钮

点击Authorize按钮,打开填写key的界面:

 填写完,点击Authorize:

这就算是在flasgger全局,都增加了校验,后续就可以在header中获取到Authorize的值了:

例如:

标签:Authorize,flasgger,bearer,python,header,点击,template,swagger
来源: https://blog.csdn.net/chanelwtt/article/details/122717632