swagger-ui 添加 api_token 以在 CURL 示例中查询两次
swagger-ui adds api_token to query twice in CURL example
我正在设置我们的 api 文档,我正在使用 swagger-spec 和 swagger ui。
除了我的 CURL 示例将我们的 access_token 添加了两次
之外,我的一切正常
curl -X DELETE --header "Accept: application/json" "http://api host/api/user?filter%5Bid%5D%5BEQUAL%5D=1&access_token=Token_TOKANE&access_token=Token_TOKANE"
我在 swagger_ui 索引
中重命名了 api_key
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("access_token", key, "query");
window.swaggerUi.api.clientAuthorizations.add("access_token", apiKeyAuth);
截图
Swagger 删除路径
delete:
tags:
- User
summary: Delete user from you organization
operationId: deleteUser
description: Deletes a single by id. Gets id from filter param in query
parameters:
- name: filter[id][EQUAL]
in: query
type: integer
required: true
description: id to delete
responses:
200:
description: OK
schema:
$ref: '#/definitions/Message'
security:
- access_token: []
安全定义
securityDefinitions:
access_token:
type: string
in: query
name: access_token
同样的issue可以看swagger-uilive demo
如果有人知道修复或解决方法,我将不胜感激。
swagger-js 刚刚解决了这个问题。您可以更新您的 swagger-ui,方法是在本地 building 并针对 swagger-ui 的本地 build 使用 npm link
。带有此修复程序的 swagger-ui 即将发布。
我正在设置我们的 api 文档,我正在使用 swagger-spec 和 swagger ui。
除了我的 CURL 示例将我们的 access_token 添加了两次
之外,我的一切正常curl -X DELETE --header "Accept: application/json" "http://api host/api/user?filter%5Bid%5D%5BEQUAL%5D=1&access_token=Token_TOKANE&access_token=Token_TOKANE"
我在 swagger_ui 索引
中重命名了 api_keyvar apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("access_token", key, "query");
window.swaggerUi.api.clientAuthorizations.add("access_token", apiKeyAuth);
截图
Swagger 删除路径
delete:
tags:
- User
summary: Delete user from you organization
operationId: deleteUser
description: Deletes a single by id. Gets id from filter param in query
parameters:
- name: filter[id][EQUAL]
in: query
type: integer
required: true
description: id to delete
responses:
200:
description: OK
schema:
$ref: '#/definitions/Message'
security:
- access_token: []
安全定义
securityDefinitions:
access_token:
type: string
in: query
name: access_token
同样的issue可以看swagger-uilive demo
如果有人知道修复或解决方法,我将不胜感激。
swagger-js 刚刚解决了这个问题。您可以更新您的 swagger-ui,方法是在本地 building 并针对 swagger-ui 的本地 build 使用 npm link
。带有此修复程序的 swagger-ui 即将发布。