【发布时间】:2017-03-06 15:48:56
【问题描述】:
我正在使用 swagger 来记录我的 java REST API。
X-Auth-Token 应该在每个 api 的标头中发送(除了一个)。
我想要像授权的宠物商店V2那样的按钮。
可以在这里找到:http://petstore.swagger.io/
我知道它是在 jason\yaml 文件中定义的,它是由 swagger 生成的。 确切地说,它是在 yaml 中完成的,如下所示:
securityDefinitions:
petstore_auth:
type: "oauth2"
authorizationUrl: "http://petstore.swagger.io/oauth/dialog"
flow: "implicit"
scopes:
write:pets: "modify pets in your account"
read:pets: "read your pets"
api_key:
type: "apiKey"
name: "api_key"
in: "header"
我用注释做的所有招摇的文档。但我找不到执行此按钮的注释。 你能帮我找到这个注释吗?
谢谢!
【问题讨论】:
-
找到解决方案了吗?
-
通过在@SwaggerDefinition 中添加字段。我会在周日更新答案
标签: java annotations swagger swagger-ui