【发布时间】:2018-08-08 03:33:21
【问题描述】:
我正在使用 Swagger UI 生成 api 文档,并想在此页面中调用 api 获取葡萄 api。 我将 security_definitions 设置如下:
add_swagger_documentation(
hide_documentation_path: true,
doc_version: '18.0',
mount_path: '/api_doc',
add_version: true,
hide_format: true,
info: {
title: "Search API documentation"
},
security_definitions: {
ApiKeyAuth:{
type: "apiKey",
name: "X-Auth-Token",
in: "header",
description: "Requests should pass an api_key header."
}
},
security: {
ApiKeyAuth: []
}
)
但是当输入值并发送请求时,请求头中没有值。
【问题讨论】:
标签: swagger-ui swagger-2.0 grape-api auth-token