我正在设置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
在swagger-ui live demo
中可以看到同样的问题如果有人知道修复或解决方法,我会很感激。
答案 0 :(得分:1)
这已在swagger-js中解决。您可以通过在本地构建并使用npm link
对抗本地构建的swagger-ui来更新您的swagger-ui。很快就会发布swagger-ui。