private List<ApiKey> securitySchemes() {
List<ApiKey> apiKeyList= new ArrayList();
apiKeyList.add(new ApiKey("Authorization", "Authorization", "header"));
return apiKeyList;
}
生成的添加Token的对话框如下:
用户输入“Bearer ${token}”,这样比较麻烦,怎样实现用户只需要输入${token},swagger能够自动添加上“Bearer”
请使用
Bearer Authentication
而不是apiKey
的方式。它将会在 http header 中自动增加
schema 配置
Bearer Authentication