Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望 Authorize 的 name 可配置 #67

Open
MasterJoyHunan opened this issue Feb 6, 2023 · 4 comments
Open

希望 Authorize 的 name 可配置 #67

MasterJoyHunan opened this issue Feb 6, 2023 · 4 comments

Comments

@MasterJoyHunan
Copy link

"securityDefinitions": {
    "apiKey": {
      "type": "apiKey",
      "description": "Enter JWT Bearer token **_only_**",
      "name": "Authorization", # 有时会使用自定义的 key 
      "in": "header"
    }
  }
@MasterJoyHunan
Copy link
Author

在你的工具中已经写死了

newSecDefValue.Name = "Authorization"

@asppj
Copy link

asppj commented Apr 12, 2023

好像是没人维护了

@kevwan
Copy link
Contributor

kevwan commented Apr 21, 2023

@MaxToby PTAL.

@xing393939
Copy link

我基于这个重新写了插件,支持了这个,你可以试试:

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
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants