swaggo / swag

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

Swag generate empty path #1780

Open flyskea opened 5 months ago

flyskea commented 5 months ago

Describe the bug generate empty path, but in v1.8.2, it's ok

To Reproduce Steps to reproduce the behavior:

  1. run command 'swag init -g ./internal/server/http/apiv1.go -dir ./ --parseInternal'

Screenshots project tree: image handler comment: image: image

Your swag version 1.16.3

Your go version 1.21.4

Desktop (please complete the following information):

Mrbeyond commented 4 months ago

Same issue here!

Your swag version 1.16.3

Your go version go version go1.22.2 linux/amd64

Desktop (please complete the following information):

OS: Ubuntu Version: 23.10

bobsongplus commented 2 months ago

I also have the same issue and make some deep digs. I found that if your code path is in $ROOT or the path prefix is $ROOT, will filter out the source code.