希望 Authorize 的 name 可配置
MasterJoyHunan opened this issue · 4 comments
MasterJoyHunan commented
"securityDefinitions": {
"apiKey": {
"type": "apiKey",
"description": "Enter JWT Bearer token **_only_**",
"name": "Authorization", # 有时会使用自定义的 key
"in": "header"
}
}
MasterJoyHunan commented
在你的工具中已经写死了
goctl-swagger/generate/parser.go
Line 84 in a78fb7b
asppj commented
好像是没人维护了
xing393939 commented
我基于这个重新写了插件,支持了这个,你可以试试:
go install github.com/xing393939/gotools/cmd/gozero-swagger@latest
goctl api plugin -plugin gozero-swagger="swagger -host localhost:8888" -api gateway.api -dir .
// api文件的@server块这样写:
@server(
header: token // Authorize name就是token
)