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

生成文档时swag会报错 #29

Open
lirixiang opened this issue Mar 26, 2024 · 3 comments
Open

生成文档时swag会报错 #29

lirixiang opened this issue Mar 26, 2024 · 3 comments

Comments

@lirixiang
Copy link

Describe the bug
生成文档时swag会报错

To Reproduce
Steps to reproduce the behavior, if applicable:

  1. The code is

// @title ChatGPT_MJ_aggregation_next api docs
// @description http server api docs
// @schemes http https
// @Version 2.0
// @host localhost:8080
// @securityDefinitions.apikey BearerAuth
// @in header
// @name Authorization
// @description "Type Bearer your-jwt-token" to Value
func main() {
initial.InitApp()
services := initial.CreateServices()
closes := initial.Close(services)

a := app.New(services, closes)
a.Run()

}

2. The error is

// @description "Type Bearer your-jwt-token" to Value

3.将// @description "Type Bearer your-jwt-token" to Value 改成
// @description Type Bearer your-jwt-token to Value  可以解决
@zhufuyi
Copy link
Owner

zhufuyi commented Mar 27, 2024

生成代码是下面这样,没有报错

// @description Type "Bearer your-jwt-token" to Value

是不是你手动改为下面这样导致swag报的错误呢

// @description "Type Bearer your-jwt-token" to Value

@lirixiang
Copy link
Author

image image 用浏览器抓取了一下,是会报错

@zhufuyi
Copy link
Owner

zhufuyi commented Mar 28, 2024

我用的swag版本是v1.8.12,生成swagger文档时,"会被转义\",因此不会报错。

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

2 participants