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 init #1820

Open
Jerry-yz opened this issue Jun 7, 2024 · 4 comments
Open

swag init #1820

Jerry-yz opened this issue Jun 7, 2024 · 4 comments

Comments

@Jerry-yz
Copy link

Jerry-yz commented Jun 7, 2024

Describe the bug
A clear and concise description of what the bug is.
when i use swag init generate docs.go, but this file has error, swag.Spec struct has not LeftDelim field and RightDelim field
how can i fix it
var SwaggerInfo = &swag.Spec{
Version: "",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "",
Description: "",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Your swag version
e.g. 1.4.1
swag version v1.16.3
Your go version
e.g. 1.12.0
go version go1.22.3 linux/amd64
Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser: [e.g. chrome, safari]
  • Version: [e.g. 22]

Additional context
Add any other context about the problem here.

@DrowningOtter
Copy link

how to fix this ?

@buckldav
Copy link

As a workaround, I just removed those lines in my Dockerfile and everything ran fine.

RUN swag init
RUN sed -i s/LeftDelim.*//g ./docs/docs.go
RUN sed -i s/RightDelim.*//g ./docs/docs.go

My versions

  • github.com/swaggo/echo-swagger v1.4.1
  • github.com/swaggo/swag v1.16.3
  • go version go1.22.4 linux/amd64

@DrowningOtter
Copy link

got it, thanks!

@Jerry-yz
Copy link
Author

As a workaround, I just removed those lines in my Dockerfile and everything ran fine.

RUN swag init
RUN sed -i s/LeftDelim.*//g ./docs/docs.go
RUN sed -i s/RightDelim.*//g ./docs/docs.go

My versions

  • github.com/swaggo/echo-swagger v1.4.1
  • github.com/swaggo/swag v1.16.3
  • go version go1.22.4 linux/amd64

only manual processing? have other methods?
has bug in source code?

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

3 participants