swaggo / swag

Automatically generate RESTful API documentation with Swagger 2.0 for Go.
MIT License
10.45k stars 1.19k forks source link

example/celler unknown field LeftDelim #1843

Open rvernica opened 1 month ago

rvernica commented 1 month ago

Describe the bug

Example code not working.

To Reproduce

Steps to reproduce the behavior:

> git clone https://github.com/swaggo/swag.git
> cd swag/example/celler
> swag init
> go run main.go
# github.com/swaggo/swag/example/celler/docs
docs/docs.go:1044:2: unknown field LeftDelim in struct literal of type "github.com/swaggo/swag".Spec
docs/docs.go:1045:2: unknown field RightDelim in struct literal of type "github.com/swaggo/swag".Spec

Expected behavior

Example application starting successfully.

Screenshots

N/A

Your swag version

Latest c7f1cd8

Your go version

> go version
go version go1.22.4 linux/amd64

Desktop (please complete the following information):

Additional context

None

rvernica commented 1 month ago

Workaround:

> sed -i 's/LeftDelim.*//g' ./docs/docs.go
> sed -i 's/RightDelim.*//g' ./docs/docs.go
Danli741 commented 1 month ago

Please have a look at this closed issue: https://github.com/swaggo/swag/issues/1568