swagger_template = {"securityDefinitions": {"APIKeyHeader": {"type": "apiKey", "name": "Authorization", "in": "header"}}} Swagger(app, template=swagger_template)
添加这个 template之后,会出现Authorize,点击这个按钮
点击Authorize按钮,打开填写key的界面:
填写完,点击Authorize:
这就算是在flasgger全局,都增加了校验,后续就可以在header中获取到Authorize的值了:
例如: